This repository was archived by the owner on Nov 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (55 loc) · 1.78 KB
/
Makefile
File metadata and controls
68 lines (55 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
build:
CGO_ENABLED=0 GOOS=linux go build -a -o bin/devbookd .
build-darwin:
GOOS=darwin go build -a -o bin/darwin/devbookd .
build-debug-devbookd:
CGO_ENABLED=1 GOOS=linux go build -race -gcflags=all="-N -l" -o bin/debug/devbookd
build-docker:
DOCKER_BUILDKIT=1 docker build -t devbookd-debug . -f debug.Dockerfile
start-docker:
docker run \
--name devbookd \
-p 49982:49982 \
-p 2345:2345 \
-p 9999:9999 \
--rm \
-it devbookd-debug \
/bin/ash
start-devbookd-docker:
docker run \
--name devbookd \
-p 49982:49982 \
-p 2345:2345 \
-p 9999:9999 \
--rm \
-i devbookd-debug \
/usr/bin/devbookd -debug | jq .
start-debug-docker:
docker run \
--name devbookd \
-p 49982:49982 \
-p 2345:2345 \
-p 9999:9999 \
-d devbookd-debug sh -l -c "/go/bin/dlv --listen=:2345 --headless=true --log=true --log-output=debugger,debuglineerr,gdbwire,lldbout,rpc --accept-multiclient --api-version=2 exec /usr/bin/devbookd"
stop-debug-docker:
docker kill `docker ps -a -q --filter ancestor=devbookd-debug`
connect-wscat:
npx -y wscat -c ws://127.0.0.1:49982/ws
# You run the parametrized command like this:
# make hostname=s3izkj4c-beba8075.ondevbook.com metric=heap interval=90 run-profiler
run-profiler:
go tool pprof -http :9991 https://49982-$(hostname)/debug/pprof/$(metric)?seconds=$(interval)\&timeout=120
install-profiler-deps:
sudo apt update && sudo apt install graphviz
# Build devbookd and start a detached container you can connect to with a debugger
run-debug:
make build-docker
make start-debug-docker
# Build devbookd and start a interactive container with devbookd as a main process
run-devbookd:
make build-docker
make start-devbookd-docker
# Build devbookd and start a interactive container where you can start devbookd manually
run-env:
make build-docker
make start-docker