-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (45 loc) · 1.01 KB
/
Makefile
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
.PHONY : serve
serve : build
APIARY_INTERFACE=localhost ./cmd/apiary/apiary
.PHONY : build
build :
go build
cd cmd/apiary && go build
.PHONY : install
install :
go build
cd cmd/apiary && go install
.PHONY : test
test :
go test ./...
.PHONY : bench
bench: export APIARY_LOGGING=false
bench :
go test ./... -run=^$$ -bench=.
.PHONY : vuln
vuln :
govulncheck ./...
.PHONY : docker-build
docker-build :
docker build --tag apiary:test .
# This assumes that the environment variables are available
.PHONY : docker-serve
docker-serve : docker-build
docker run --rm \
--publish 8090:8090 \
-e APIARY_DB \
-e APIARY_PORT \
-e APIARY_INTERFACE \
-e APIARY_LOGGING \
--name apiary \
apiary:test
GITBRANCH := $(shell git branch --show-current)
# Run Docker image associated with branch from GitHub Container Registry
.PHONY : serve-ghcr
serve-ghcr :
docker pull ghcr.io/chnm/apiary:$(GITBRANCH)
docker run --rm \
--publish 8090:8090 \
-e APIARY_DB \
--name apiary-dev \
ghcr.io/chnm/apiary:$(GITBRANCH)