-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (49 loc) · 1.13 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
##########
# Building
##########
build-docker-prod:
docker build -t docker_username/project_name:latest .
build-docker-dev:
docker build -f dev.Dockerfile -t docker_username/project_name:test .
build-docker-dev-lint:
docker build -f dev.lint.Dockerfile -t docker_username/project_name:lint .
build-go:
go get -v -t -d ./...
go build -v .
rm project_name
#########
# Linting
#########
lint-golangci:
golangci-lint run
lint-gomod:
go mod tidy
git diff --exit-code go.mod
git diff --exit-code go.sum
lint-goreleaser:
goreleaser check
lint-hadolint:
hadolint Dockerfile
hadolint dev.Dockerfile
hadolint dev.lint.Dockerfile
lint-in-docker: build-docker-dev-lint
docker run docker_username/project_name:lint
#########
# Testing
#########
test-go:
go get -v -t -d ./...
go test -v ./...
test-in-docker: build-docker-dev
docker run docker_username/project_name:test
##########
# Grouping
##########
# Testing
local-test: test-go
docker-test: test-in-docker
# Linting
local-lint: lint-golangci lint-goreleaser lint-hadolint lint-gomod
docker-lint: lint-in-docker
# Build
local-build: build-docker-prod build-docker-dev build-docker-dev-lint