Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal to add delve debugger commands #20

Merged
merged 3 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*tmp
**/.DS_Store
bcda/bcda
bcda/debug
bcdaworker/bcdaworker
bcdaworker/debug
test_results/*
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.bcda
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN openssl rsa -in /var/local/private.pem -outform PEM -pubout -out /var/local/

RUN go get github.com/tools/godep
RUN go get github.com/pressly/fresh
RUN go get -u github.com/derekparker/delve/cmd/dlv

WORKDIR /go/src/github.com/CMSgov/bcda-app
COPY . .
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.bcdaworker
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM golang:1.10.3

RUN go get github.com/tools/godep
RUN go get github.com/pressly/fresh
RUN go get -u github.com/derekparker/delve/cmd/dlv

WORKDIR /go/src/github.com/CMSgov/bcda-app
COPY . .
Expand Down
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
models:
docker-compose up -d db
echo "Waiting for db to be ready..."
sleep 5
sleep 5
PGSSLMODE=disable xo postgresql://postgres:toor@localhost:5432/bcda -o models

test:
Expand All @@ -26,4 +26,22 @@ docker-build:

docker-bootstrap: docker-build load-fixtures

.PHONY: models docker-build docker-bootstrap load-fixtures test
api-shell:
docker-compose exec api bash

worker-shell:
docker-compose exec worker bash

debug-api:
docker-compose start db queue worker
@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
@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 debug-api debug-worker api-shell worker-shell
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ services:
- "3000:3000"
depends_on:
- queue
security_opt:
- seccomp:unconfined
worker:
build:
context: .
Expand All @@ -47,3 +49,5 @@ services:
- .:/go/src/github.com/CMSgov/bcda-app
depends_on:
- queue
security_opt:
- seccomp:unconfined