-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (32 loc) · 1.09 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
include .bingo/Variables.mk
HOSTOS=$(shell uname | tr "[:upper:]" "[:lower:]")
VERSION=$(shell git tag --sort=-version:refname | head -n 1)
TOOLS_DIR=tools
TOOLS_VERSION_NANCY=v1.0.21
NANCY=$(TOOLS_DIR)/nancy-$(TOOLS_VERSION_NANCY)
NANCY_EXISTS:=$(shell test -e "$(NANCY)" && echo -n "binary exists")
setup: ## Setup necessary binary dependencies
mkdir -p $(TOOLS_DIR)
ifndef NANCY_EXISTS
wget -O $(TOOLS_DIR)/nancy-$(TOOLS_VERSION_NANCY) https://github.com/sonatype-nexus-community/nancy/releases/download/$(TOOLS_VERSION_NANCY)/nancy-$(TOOLS_VERSION_NANCY)-$(HOSTOS)-amd64
chmod +x $(TOOLS_DIR)/nancy-$(TOOLS_VERSION_NANCY)
endif
fmt: ## Run the code formatter
gofmt -l -s -w .
download-deps:
go mod download
tidy-deps:
go mod tidy
compile:
go build
unit-test:
go test -v ./...
dependency-check: ## Ensure dependencies have no vulnerabilities
go list -json -m all | $(NANCY) sleuth --skip-update-check
build: setup download-deps tidy-deps fmt unit-test compile lint
update-deps:
go get -u -t ./...
go mod tidy
lint: $(GOLANGCI_LINT) $(GORELEASER)
$(GOLANGCI_LINT) run
$(GORELEASER) check