-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (37 loc) · 1.19 KB
/
Makefile
File metadata and controls
51 lines (37 loc) · 1.19 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
MODULE=github.com/sean9999/go-delphi
CONTAINER_IMAGE=docker.io/codemonk9999/delphi
SEMVER := $$(git tag --sort=-version:refname | head -n 1)
BRANCH := $$(git branch --show-current)
REF := $$(git describe --dirty --tags --always)
GOPROXY=proxy.golang.org
info:
@printf "MODULE:\t%s\nSEMVER:\t%s\nBRANCH:\t%s\nREF:\t%s\nIMAGE:\t%s\n" $(MODULE) $(SEMVER) $(BRANCH) $(REF) $(CONTAINER_IMAGE)
tidy:
go mod tidy
clean:
go clean
go clean -modcache
rm -f ./bin/*
pkgsite:
if [ -z "$$(command -v pkgsite)" ]; then go install golang.org/x/pkgsite/cmd/pkgsite@latest; fi
docs: pkgsite
pkgsite -open .
publish:
GOPROXY=https://${GOPROXY},direct go list -m ${MODULE}@${SEMVER}
bin/delphi:
go build -o bin/delphi ./cmd/delphi
install:
go install ./cmd/delphi
docker:
docker build --no-cache -t ${CONTAINER_IMAGE}:${REF} \
-t ${CONTAINER_IMAGE}:latest \
-t ${CONTAINER_IMAGE}:${BRANCH} .
push:
docker push ${CONTAINER_IMAGE}:${REF}
docker push ${CONTAINER_IMAGE}:latest
docker push ${CONTAINER_IMAGE}:${BRANCH}
test:
go test -vet=all -race ./...
# restricted set of 'cacheable' test flags, defined as -benchtime, -cpu,
# -list, -parallel, -run, -short, -timeout, -failfast, -fullpath and -v.
.PHONY: test