forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (48 loc) · 1.74 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.PHONY: default clean install lint test assets build binaries test-release release publish-testing publish-latest publish-images
TAG_NAME := $(shell test -d .git && git describe --abbrev=0 --tags)
SHA := $(shell test -d .git && git rev-parse --short HEAD)
VERSION := $(if $(TAG_NAME),$(TAG_NAME),$(SHA))
BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
IMAGE := andig/evcc
ALPINE := 3.12
TARGETS := arm.v6,arm.v8,amd64
default: clean install npm assets lint test build
clean:
rm -rf dist/
install:
go install github.com/mjibson/esc
go install github.com/golang/mock/mockgen
npm ci
lint:
golangci-lint run
npm run lint
test:
@echo "Running testsuite"
go test ./...
npm:
npm run build
ui:
npm run build
go generate main.go
assets:
@echo "Generating embedded assets"
go generate ./...
build:
@echo Version: $(VERSION) $(BUILD_DATE)
go build -v -tags=release -ldflags '-X "github.com/andig/evcc/server.Version=${VERSION}" -X "github.com/andig/evcc/server.Commit=${SHA}"'
release-test:
goreleaser --snapshot --skip-publish --rm-dist
release:
goreleaser --rm-dist
publish-testing:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish --dry-run=false --template docker/tmpl.Dockerfile --base-runtime-image alpine:$(ALPINE) \
--image-name $(IMAGE) -v "testing" --targets=arm.v6,amd64
publish-latest:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish --dry-run=false --template docker/tmpl.Dockerfile --base-runtime-image alpine:$(ALPINE) \
--image-name $(IMAGE) -v "latest" --targets=$(TARGETS)
publish-images:
@echo Version: $(VERSION) $(BUILD_DATE)
seihon publish --dry-run=false --template docker/tmpl.Dockerfile --base-runtime-image alpine:$(ALPINE) \
--image-name $(IMAGE) -v "latest" -v "$(TAG_NAME)" --targets=$(TARGETS)