-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (29 loc) · 807 Bytes
/
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
APP=$(shell basename $(shell git remote get-url origin))
REGISTRY=darbooshka
#REGISTRY=gcr.io/k8s-k3s-386419
VERSION=$(shell git describe --tags --abbrev=0)-$(shell git rev-parse --short HEAD)
TARGETOS=linux #linux darwin windows
TARGETARCH=amd64 #amd64 arm64
format:
gofmt -s -w ./
lint:
golint
test:
go test -v
get:
go get
build: format get
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -v -o kbot -ldflags "-X="github.com/darbooshka/kbot/cmd.appVersion=${VERSION}
image:
docker build . -t ${REGISTRY}/${APP}:${VERSION}-${TARGETARCH}
push:
docker push ${REGISTRY}/${APP}:${VERSION}-${TARGETARCH}
clean:
rm -rf kbot
docker rmi ${REGISTRY}/${APP}:${VERSION}-${TARGETARCH}
linux:
$(eval TARGETOS=linux)
macos:
$(eval TARGETOS=darwin)
windows:
$(eval TARGETOS=windows)