Skip to content

Commit

Permalink
make debug-api and debug-worker commands clean up containers upon exit
Browse files Browse the repository at this point in the history
  • Loading branch information
rnagle committed Sep 13, 2018
1 parent 9459c1a commit 6748207
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ worker-shell:

debug-api:
docker-compose start db queue worker
docker-compose run -T --rm -p 3000:3000 -v $(shell pwd):/go/src/github.com/CMSgov/bcda-app api dlv debug -- start-api
@echo "Starting debugger. This may take a while..."
@-bash -c "trap 'docker-compose stop' EXIT; \
docker-compose run --no-deps -T --rm -p 3000:3000 -v $(shell pwd):/go/src/github.com/CMSgov/bcda-app api dlv debug -- start-api"

debug-worker:
docker-compose start db queue api
docker-compose run -T --rm -v $(shell pwd):/go/src/github.com/CMSgov/bcda-app worker dlv debug
@echo "Starting debugger. This may take a while..."
@-bash -c "trap 'docker-compose stop' EXIT: \
docker-compose run --no-deps -T --rm -v $(shell pwd):/go/src/github.com/CMSgov/bcda-app worker dlv debug"

.PHONY: models docker-build docker-bootstrap load-fixtures test
.PHONY: models docker-build docker-bootstrap load-fixtures test debug-api debug-worker api-shell worker-shell

0 comments on commit 6748207

Please sign in to comment.