Skip to content

Commit

Permalink
fixed cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
schmunk42 committed Jan 19, 2017
1 parent cc1f398 commit 8893eca
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test:
script:
- docker-compose up -d
- docker-compose run --rm php vendor/bin/phpunit -v --exclude caching,db
- docker-compose down -v
- docker-compose down -v --remove-orphans

test:caching:
stage: test
Expand All @@ -36,15 +36,15 @@ test:caching:
# wait for mysql (retry 30 times)
- docker-compose run --rm php bash -c "while ! curl mysql:3306; do ((c++)) && ((c==30)) && break; sleep 2; done"
- docker-compose run --rm php vendor/bin/phpunit -v --group caching
- docker-compose down -v
- docker-compose down -v --remove-orphans

test:db:
stage: test
script:
- export COMPOSE_PROJECT_NAME=${ISOLATION}db
- docker-compose up -d
- docker-compose run --rm php vendor/bin/phpunit -v --group db --exclude caching,mysql,pgsql,mssql,cubrid
- docker-compose down -v
- docker-compose down -v --remove-orphans

test:db:mysql:
stage: test
Expand All @@ -54,7 +54,7 @@ test:db:mysql:
# wait for db (retry X times)
- docker-compose run --rm php bash -c "while ! curl mysql:3306; do ((c++)) && ((c==30)) && break; sleep 2; done"
- docker-compose run --rm php vendor/bin/phpunit -v --group mysql
- docker-compose down -v
- docker-compose down -v --remove-orphans

test:db:pgsql:
stage: test
Expand All @@ -64,7 +64,7 @@ test:db:pgsql:
# wait for db (retry X times)
- docker-compose run --rm php bash -c 'while [ true ]; do curl postgres:5432; if [ $? == 52 ]; then break; fi; ((c++)) && ((c==25)) && break; sleep 2; done'
- docker-compose run --rm php vendor/bin/phpunit -v --group pgsql
- docker-compose down -v
- docker-compose down -v --remove-orphans

test:db:mssql:
stage: test
Expand All @@ -81,7 +81,7 @@ test:db:mssql:
# Note: Password has to be the last parameter
- docker-compose run --rm sqlcmd sqlcmd -S mssql -U sa -Q "CREATE DATABASE yii2test" -P Mircosoft-12345
- docker-compose run --rm php vendor/bin/phpunit -v --group mssql
- docker-compose down -v
- docker-compose down -v --remove-orphans

test:db:cubrid:
stage: test
Expand All @@ -93,7 +93,7 @@ test:db:cubrid:
- docker-compose run --rm php bash -c 'while [ true ]; do curl cubrid:1523; if [ $? == 56 ]; then break; fi; ((c++)) && ((c==20)) && break; sleep 3; done'
- sleep 5
- docker-compose run --rm php /project/vendor/bin/phpunit -v --group cubrid
- docker-compose down -v
- docker-compose down -v --remove-orphans

test:travis:
stage: test
Expand All @@ -105,24 +105,28 @@ test:travis:
# TODO: retry/wait for db
- sleep 10
- docker-compose run --rm php vendor/bin/phpunit -v --exclude mssql,cubrid,oci,wincache,xcache,zenddata,cubrid
- docker-compose down -v
- docker-compose down -v --remove-orphans

cleanup:
stage: cleanup
when: always
script:
- docker-compose down -v
- docker-compose down -v --remove-orphans
- export COMPOSE_PROJECT_NAME=${ISOLATION}caching
- docker-compose down -v
- docker-compose down -v --remove-orphans
- export COMPOSE_PROJECT_NAME=${ISOLATION}db
- docker-compose down -v
- docker-compose down -v --remove-orphans
- export COMPOSE_PROJECT_NAME=${ISOLATION}mysql
- docker-compose down -v
- docker-compose down -v --remove-orphans
- export COMPOSE_PROJECT_NAME=${ISOLATION}pgsql
- docker-compose down -v
- docker-compose down -v --remove-orphans
- export COMPOSE_PROJECT_NAME=${ISOLATION}travis
- docker-compose down -v --remove-orphans
- pushd mssql
- export COMPOSE_PROJECT_NAME=${ISOLATION}mssql
- docker-compose down -v
- docker-compose down -v --remove-orphans
- popd
- pushd cubrid
- export COMPOSE_PROJECT_NAME=${ISOLATION}cubrid
- docker-compose down -v
- export COMPOSE_PROJECT_NAME=${ISOLATION}travis
- docker-compose down -v
- docker-compose down -v --remove-orphans
- popd

0 comments on commit 8893eca

Please sign in to comment.