forked from den-vasyliev/kbot-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 1002 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (28 loc) · 1002 Bytes
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
.PHONY: all
all: image push
APP=$(shell basename $(shell git remote get-url origin))
REGESTRY=denvasyliev
CURRENTARCH=$(shell dpkg --print-architecture)
VERSION=$(shell git describe --tags --abbrev=0)-$(shell git rev-parse HEAD|cut -c1-7)
HELM_VERSION=$(shell git describe --tags --abbrev=0)
TARGETOS=linux
TARGETARCH=arm64
format:
gofmt -s -w ./
lint: format
golint
test: lint
go test -v
build: format
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=$(shell dpkg --print-architecture) go build -v -o kbot -ldflags "-X="github.com/den-vasyliev/kbot/cmd.appVersion=${VERSION}
image:
docker build . -t ${REGESTRY}/${APP}:${VERSION}-${TARGETARCH} --no-cache --build-arg TARGETOS=${TARGETOS} --build-arg TARGETARCH=${TARGETARCH}
push:
docker push ${REGESTRY}/${APP}:${VERSION}-${TARGETARCH}
helm-package:
helm package helm/ --version ${HELM_VERSION} --app-version ${VERSION}
helm-push:
helm push ${APP}-${HELM_VERSION}.tgz oci://ghcr.io/${REGESTRY}/charts
clean:
rm -rf kbot
rm -f ${APP}-*.tgz