Skip to content

Commit 27efb8a

Browse files
authored
feat: add debug script from bootstrap (#10)
1 parent 309e620 commit 27efb8a

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

root/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ devserver: build
123123
if [[ -z $$SKIP_DEVCONFIG ]]; then ./.bootstrap/shell/devconfig.sh; fi
124124
OUTREACH_ACCOUNTS_BASE_URL=$(ACCOUNTS_URL) MY_NAMESPACE=$(E2E_NAMESPACE) OUTREACH_DOMAIN=$(OUTREACH_DOMAIN) $(BINDIR)/$(BIN_NAME)
125125

126+
## debug: run the service via delve
127+
.PHONY: debug
128+
debug: build
129+
if [[ -z $$SKIP_DEVCONFIG ]]; then ./.bootstrap/shell/devconfig.sh; fi
130+
OUTREACH_ACCOUNTS_BASE_URL=$(ACCOUNTS_URL) MY_NAMESPACE=$(E2E_NAMESPACE) OUTREACH_DOMAIN=$(OUTREACH_DOMAIN) ./.bootstrap/shell/debug.sh
131+
126132
## docker-build: build docker image for dev environment
127133
.PHONY: docker-build
128134
docker-build:

shell/debug.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
5+
6+
# shellcheck source=./lib/bootstrap.sh
7+
source "$SCRIPTS_DIR/lib/bootstrap.sh"
8+
9+
export GOPROXY=https://proxy.golang.org
10+
export GOPRIVATE="github.com/getoutreach/*"
11+
export CGO_ENABLED=1
12+
13+
set -ex
14+
15+
exec "$SCRIPTS_DIR/gobin.sh" github.com/go-delve/delve/cmd/dlv@v"$(get_application_version "delve")" debug --build-flags="-tags=or_dev" "$(get_repo_directory)/cmd/$(get_app_name)"

versions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ grpcui: 1.0.0
55
golangci-lint: 1.36.0
66
jsonnetfmt: 0.16.0
77
goimports: 0.1.0
8+
delve: 1.6.0

0 commit comments

Comments
 (0)