Skip to content

Commit

Permalink
chore(cibuild): remove one-off containers after execution
Browse files Browse the repository at this point in the history
  • Loading branch information
difernandez committed Aug 2, 2019
1 parent 3bddddc commit 07de3d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/potassium/assets/bin/cibuild.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 07de3d2

Please sign in to comment.