generated from gleich/go_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (54 loc) · 1.29 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
##########
# Building
##########
build-docker-prod:
docker build -t mattgleich/gh_fsync:latest .
build-docker-dev:
docker build -f docker/dev.Dockerfile -t mattgleich/gh_fsync:test .
build-docker-dev-lint:
docker build -f docker/dev.lint.Dockerfile -t mattgleich/gh_fsync:lint .
build-docker-platform:
docker build -f docker/platform.Dockerfile -t mattgleich/gh_fsync:platform .
build-go:
go get -v -t -d ./...
go build -v .
rm gh_fsync
#########
# Linting
#########
lint-golangci:
golangci-lint run
lint-gomod:
go mod tidy
git diff --exit-code go.mod
git diff --exit-code go.sum
lint-hadolint:
hadolint Dockerfile
hadolint docker/dev.Dockerfile
hadolint docker/dev.lint.Dockerfile
lint-in-docker: build-docker-dev-lint
docker run mattgleich/gh_fsync:lint
#########
# Testing
#########
test-go:
go get -v -t -d ./...
go test -v ./...
test-in-docker: build-docker-dev
docker run mattgleich/gh_fsync:test
###########
# Releasing
###########
release: build-docker-platform
docker push mattgleich/gh_fsync:platform
##########
# Grouping
##########
# Testing
local-test: test-go
docker-test: test-in-docker
# Linting
local-lint: lint-golangci lint-hadolint lint-gomod
docker-lint: lint-in-docker
# Build
local-build: build-docker-prod build-docker-dev build-docker-dev-lint build-docker-platform