-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (21 loc) · 722 Bytes
/
Makefile
File metadata and controls
29 lines (21 loc) · 722 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
.PHONY: clean check test build
TAG_NAME := $(shell git tag -l --contains HEAD)
SHA := $(shell git rev-parse HEAD)
VERSION := $(if $(TAG_NAME),$(TAG_NAME),$(SHA))
BUILD_DATE := $(shell date -u '+%Y-%m-%d_%I:%M:%S%p')
default: clean check test build
clean:
rm -rf dist/ builds/ cover.out
build: clean
@echo Version: $(VERSION)
go build -v -ldflags '-X "main.version=${VERSION}" -X "main.commit=${SHA}" -X "main.date=${BUILD_DATE}"' -o mjolnir
test: clean
go test -v -cover ./...
check:
golangci-lint run
image:
docker build -t ldez/gha-mjolnir:latest .
docker tag ldez/gha-mjolnir:latest ldez/gha-mjolnir:${VERSION}
publish-image:
docker push ldez/gha-mjolnir:latest
docker push ldez/gha-mjolnir:${VERSION}