-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (48 loc) · 1.33 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
# build parameters
BUILD_FOLDER = dist
APP_VERSION = $(git describe --tags --always)
PACKAGES = $(go list ./...)
GOLANG_VERSION = 1.20.4
PACKAGE_NAME = github.com/archway-network/endpoint-controller
DOCKER := $(shell which docker)
all: install
install: go.sum
go install cmd/endpoint-controller.go
install-debug: go.sum
go build -gcflags="all=-N -l" -o $(BUILD_FOLDER)/endpoint-controller cmd/endpoint-controller.go
build: clean
@echo build binary to $(BUILD_FOLDER)
goreleaser build --single-target --config .goreleaser.yaml --snapshot --clean
@echo create deployment manifest
kustomize build k8s > dist/bundle.yaml
@echo done
release:
$(DOCKER) run \
--rm \
-v $(HOME)/.docker/config.json:/root/.docker/config.json \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-e GITHUB_TOKEN="$(GITHUB_TOKEN)" \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:v$(GOLANG_VERSION) \
--clean \
clean:
@echo clean build folder $(BUILD_FOLDER)
rm -rf $(BUILD_FOLDER)
@echo done
go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
GO111MODULE=on go mod verify
tests-ci:
@go get ./...
@go test ./...
test:
@go test ./...
test_coverage:
@go test ./... -coverprofile=coverage.out
vet:
@go vet
lint:
@echo "--> Running linter"
@golangci-lint run
@go mod verify