forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 1.14 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
.PHONY: default clean install lint test assets build binaries 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 install assets lint test build
clean:
rm -rf dist/
install:
go install golang.org/x/tools/cmd/stringer
go install github.com/mjibson/esc
go install github.com/golang/mock/mockgen
lint:
golangci-lint run
test:
@echo "Running testsuite"
go test ./...
assets:
@echo "Generating embedded assets"
go generate ./...
build:
@echo Version: $(VERSION) $(BUILD_DATE)
go build -v -ldflags '-X "github.com/andig/evcc/server.Version=${VERSION}" -X "github.com/andig/evcc/server.Commit=${SHA}"'
publish-images:
@echo Version: $(VERSION) $(BUILD_DATE)
# seihon publish -v "$(TAG_NAME)" -v "latest" --image-name andig/evcc1 --base-runtime-image alpine --dry-run=false --targets=arm.v6,amd64
docker build -t "andig/evcc:latest" . && docker push andig/evcc:latest
test-release:
goreleaser --snapshot --skip-publish --rm-dist
release:
goreleaser --rm-dist