-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (50 loc) · 1.48 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
56
57
58
59
60
61
62
63
CWD = $(shell pwd)
SKAFFOLD_DEFAULT_REPO ?= img.pitz.tech/mya
VERSION ?= latest
define HELP_TEXT
Welcome to pages!
Targets:
help provides help text
test run tests
docker rebuild the pages docker container
docker/release releases pages
legal prepends legal header to source code
dist recompiles pages binaries
endef
export HELP_TEXT
help:
@echo "$$HELP_TEXT"
docker: .docker
.docker:
docker build . \
--tag $(SKAFFOLD_DEFAULT_REPO)/pages:latest \
--tag $(SKAFFOLD_DEFAULT_REPO)/pages:$(VERSION) \
--file ./cmd/pages/Dockerfile
docker/release:
docker buildx build . \
--platform linux/amd64,linux/arm64 \
--label "org.opencontainers.image.source=https://code.pitz.tech/mya/pages" \
--label "org.opencontainers.image.version=$(VERSION)" \
--label "org.opencontainers.image.licenses=agpl3" \
--label "org.opencontainers.image.title=pages" \
--label "org.opencontainers.image.description=" \
--tag $(SKAFFOLD_DEFAULT_REPO)/pages:latest \
--tag $(SKAFFOLD_DEFAULT_REPO)/pages:$(VERSION) \
--file ./cmd/pages/Dockerfile \
--push
# actual targets
test:
go test -v -race -coverprofile=.coverprofile -covermode=atomic ./...
legal: .legal
.legal:
addlicense -f ./legal/header.txt -skip yaml -skip yml .
dist: .dist
.dist:
sh ./scripts/dist-go.sh
# useful shortcuts for release
tag/release:
npm version "$(shell date +%y.%m.0)"
git push --follow-tags
tag/patch:
npm version patch
git push --follow-tags