forked from andig/gravo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (22 loc) · 822 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
.PHONY: default clean lint test build publish-images test-release release
TAG_NAME := $(shell git tag -l --contains HEAD)
SHA := $(shell git rev-parse --short HEAD)
VERSION := $(if $(TAG_NAME),$(TAG_NAME),$(SHA))
BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
default: clean lint test build
clean:
rm -rf dist/ cover.out
lint:
golangci-lint run
test: clean
go test ./...
build: clean
@echo Version: $(VERSION) $(BUILD_DATE)
go build -v -ldflags '-X "main.version=${VERSION}" -X "main.commit=${SHA}" -X "main.date=${BUILD_DATE}"' -o gravo
publish-images:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish -v "$(TAG_NAME)" -v "latest" --image-name andig/gravo --base-runtime-image alpine --dry-run=false
test-release:
goreleaser --snapshot --skip-publish --rm-dist
release:
goreleaser --rm-dist