From 07de3d21760f97c61ae585e056f42cd79b473600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fern=C3=A1ndez?= Date: Fri, 2 Aug 2019 12:14:25 -0400 Subject: [PATCH] chore(cibuild): remove one-off containers after execution --- lib/potassium/assets/bin/cibuild.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/potassium/assets/bin/cibuild.erb b/lib/potassium/assets/bin/cibuild.erb index 351f8e3d..db09f633 100644 --- a/lib/potassium/assets/bin/cibuild.erb +++ b/lib/potassium/assets/bin/cibuild.erb @@ -15,7 +15,7 @@ build(){ # Wait services to be ready wait_services(){ function test_service { - docker-compose $DOCKER_COMPOSE_ARGS run test sh -c "nc -z $1 $2" + docker-compose $DOCKER_COMPOSE_ARGS run --rm test sh -c "nc -z $1 $2" } count=0 @@ -41,16 +41,16 @@ wait_services(){ # Prepare dependencies dependencies(){ - docker-compose $DOCKER_COMPOSE_ARGS run test bundle install + docker-compose $DOCKER_COMPOSE_ARGS run --rm test bundle install } assets() { - docker-compose $DOCKER_COMPOSE_ARGS run test /bin/bash -c "bin/setup && bundle exec rake assets:precompile" + docker-compose $DOCKER_COMPOSE_ARGS run --rm test /bin/bash -c "bin/setup && bundle exec rake assets:precompile" } # Prepare database database(){ - docker-compose $DOCKER_COMPOSE_ARGS run test bundle exec rake db:create db:schema:load + docker-compose $DOCKER_COMPOSE_ARGS run --rm test bundle exec rake db:create db:schema:load } # Run the specs @@ -59,7 +59,7 @@ tests(){ RSPEC_JUNIT_ARGS="-r rspec_junit_formatter --format RspecJunitFormatter -o $HOME/.rspec_reports/junit.xml" RSPEC_FORMAT_ARGS="--format progress --no-color" } - docker-compose $DOCKER_COMPOSE_ARGS run test bundle exec rspec spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS + docker-compose $DOCKER_COMPOSE_ARGS run --rm test bundle exec rspec spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS } # Run the complete ci build