Hi, I have a fairly big .travis.yml that I want to separate in different files, specificaly the before_install parts.
I found the new functionality of import syntax that I thought corresponds to this use case, though I do not manage to use it, the build is not triggered after my push.
I have activated Build Config Validation feature and tested also with version: ~> 1.0.
I thought I could write like this, do you think there’s mistake in my code or in my understanding?
Yes, I would want to import 3 docker relative parts into before_install and one docker relative part into script, respectively build, run, config, then metrics.
The working single .yml file is like this
before_install:
- export MAVEN_OPTS="-Xms512m -Xmx3g -XX:PermSize=256m $MAVEN_OPTS"
# Docker configuration
- docker build -t mysql
-f src/test/resources/docker/Dockerfile.mysql .
- docker build -t mysql
-f src/test/resources/docker/Dockerfile.mysql-5.5.40 .
- docker build -t postgres
-f src/test/resources/docker/Dockerfile.postgres .
- docker build -t sqlserver
-f src/test/resources/docker/Dockerfile.sqlserver .
- docker run --name jsql-mysql
--publish 3306:3306
-e MYSQL_ROOT_PASSWORD=my-secret-pw
-d mysql
- docker run --name jsql-mysql-5.5.40
--publish 3307:3306
-e MYSQL_ROOT_PASSWORD=my-secret-pw
-d mysql:5.5.40
- docker run --name jsql-postgres
--publish 5432:5432
-e POSTGRES_PASSWORD=my-secret-pw
-d postgres
-c 'shared_buffers=256MB'
-c 'max_connections=1000'
- docker run --name jsql-sqlserver
--publish 1434:1434
--publish 1433:1433
-e "ACCEPT_EULA=Y"
-e "SA_PASSWORD=yourStrong(!)Password"
-u 0:0
-d sqlserver
- docker images && docker ps && pwd
# Buff MySQL
- docker exec -it jsql-mysql /bin/bash
-c "
mysql -uroot -pmy-secret-pw -e '
SET GLOBAL max_connections = 100000;
SET GLOBAL thread_cache_size = 16384;
SET GLOBAL table_open_cache = 524288;
';
"
# Check MySQL status
- docker exec -it jsql-mysql /bin/bash
-c "
mysql -uroot -pmy-secret-pw -e '
SHOW GLOBAL variables WHERE Variable_name RLIKE \"thread_cache_size|^max_connections|table_open_cache\";
SHOW GLOBAL status WHERE Variable_name RLIKE \"Threads_cached|Max_used_connections|Threads_created|Connections|Opened_tables|Threads_connected|Threads_running|^Queries\"
';
"
# Check Postgres status
- docker exec -it jsql-postgres /bin/bash
-c "
export PGPASSWORD=my-secret-pw;
psql -U postgres -h 127.0.0.1 -d \"\" -e -a -c '
show max_connections;
';
"
- sleep 10s
- sudo docker exec -it jsql-sqlserver /opt/mssql-tools/bin/sqlcmd -S "tcp:127.0.0.1,1434" -U SA -P "yourStrong(!)Password" -Q "select @@version"
script:
- mvn clean verify sonar:sonar
# Check MySQL status
- docker exec -it jsql-mysql /bin/bash
-c "
mysql -uroot -pmy-secret-pw -e '
SHOW GLOBAL status WHERE Variable_name RLIKE \"Threads_cached|Max_used_connections|Threads_created|Connections|Opened_tables|Threads_connected|Threads_running|^Queries\"
';
"
Ok, I didn’t know the Requests panel, I see the error now , but I can’t figure out what’s different in file metrics.yml than it is in the three other ones.
REM Buff MySQL
docker exec -it jsql-mysql /bin/bash\
-c "\
mysql -uroot -pmy-secret-pw -e '\
SET GLOBAL max_connections = 100000;\
SET GLOBAL thread_cache_size = 16384;\
SET GLOBAL table_open_cache = 524288;\
';\
"
I’m thinking… the structure of your previous YAML files are wrong (it was a simple array); it was a fragment, whereas we expect to find complete YAML file that confirm to our specifications and perform merges and what not to construct the configuration.
I was figuring that YAML was a fairly simple string tree, but I’m missing some notions described in the documentation to understand completely what’s happening:
sections (keys) that hold maps (hashes), and concatenates sequences (arrays)
Did you end up resolving this issue, because I ran into something similar. In my main repo’s yml, I’m trying to import a yml from a submodule, but when I commit to my main repo, a build doesn’t trigger. In the requests tab, it shows the request was received and build created successfully, but no build is actually created. In the main repo’s yml, if I don’t specify version: ~> 1.0, then a build is successfully created but the import command has no effect. If I do specify version to enable the beta feature, no build is created.