-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (27 loc) · 827 Bytes
/
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
default: release
build:
@echo "Building project"
GOOS=linux go build -o bin/cgstat main.go
fmt:
@echo "Running go fmt"
go fmt
lint:
@if [ ! -d /tmp/golangci-lint ]; then \
echo "Installing golangci-lint"; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.51.0; \
mkdir -p /tmp/golangci-lint/; \
mv ./bin/golangci-lint /tmp/golangci-lint/golangci-lint; \
fi; \
/tmp/golangci-lint/golangci-lint run ./... --issues-exit-code=1 \
tidy:
echo "Running go mod tidy"
go mod tidy
vulncheck:
@if [ ! `command -v govulncheck` ]; then \
echo "Installing govulncheck"; \
go install golang.org/x/vuln/cmd/govulncheck@latest; \
fi; \
GOOS=linux govulncheck ./...
install: build
cp ./bin/cgstat /usr/local/bin/
release: fmt lint tidy vulncheck build