-
Notifications
You must be signed in to change notification settings - Fork 131
/
Makefile.devcontainer
65 lines (48 loc) · 2.42 KB
/
Makefile.devcontainer
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
# Devcontainer Makefile.
include Makefile.include
release-dev-managed: ## Build pmm-managed
make -C managed release-dev
release-dev-agent: ## Build pmm-agent
make -C agent release-dev
release-vmproxy: ## Build vmproxy
make -C vmproxy release
# used by host Makefile
_bash:
/bin/bash
PMM_RELEASE_PATH ?= ./bin
run-managed: release-dev-managed ## Replace pmm-managed from build, restart and tail logs
supervisorctl stop pmm-managed
cp $(PMM_RELEASE_PATH)/pmm-managed /usr/sbin/pmm-managed
supervisorctl start pmm-managed &
supervisorctl tail -f pmm-managed
run-managed-ci: release-dev-managed ## Replace pmm-managed from build, restart (used in CI)
supervisorctl stop pmm-managed
cp $(PMM_RELEASE_PATH)/pmm-managed /usr/sbin/pmm-managed
supervisorctl start pmm-managed
run-agent: release-dev-agent ## Replace pmm-agent from build and restart
supervisorctl stop pmm-agent
cp $(PMM_RELEASE_PATH)/pmm-agent /usr/sbin/pmm-agent
supervisorctl start pmm-agent
run-vmproxy: release-vmproxy
supervisorctl stop vmproxy
cp $(PMM_RELEASE_PATH)/vmproxy /usr/sbin/vmproxy
supervisorctl start vmproxy
run-all: run-agent run-managed ## Run pmm-managed and pmm-agent
run: ## Deprecated
echo "Deprecated: please use run-all"
# TODO https://jira.percona.com/browse/PMM-3484, see maincover_test.go
# run-race-cover: install-race ## Run pmm-managed with race detector and collect coverage information.
# go test -coverpkg="github.com/percona/pmm/managed/..." \
# -tags maincover \
# $(PMM_LD_FLAGS) \
# -race -c -o bin/pmm-managed.test
# bin/pmm-managed.test -test.coverprofile=cover.out -test.run=TestMainCover $(RUN_FLAGS)
psql: ## Open database for the pmm-managed instance in psql shell
env PGPASSWORD=pmm-managed psql -U pmm-managed pmm-managed
psql-test: ## Open database used in unit tests in psql shell
env psql -U postgres pmm-managed-dev
dlv/attach: ## Attach Delve to `pmm-managed`
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient attach $(shell pgrep pmm-managed)
refresh-swagger: ## Refresh swagger files
cp /root/go/src/github.com/percona/pmm/api/swagger/swagger.json /usr/share/pmm-managed/swagger/swagger.json
cp /root/go/src/github.com/percona/pmm/api/swagger/swagger-dev.json /usr/share/pmm-managed/swagger/swagger-dev.json