forked from gatecheckdev/gatecheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
37 lines (28 loc) · 990 Bytes
/
justfile
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
INSTALL_DIR := env('INSTALL_DIR', '/usr/local/bin')
# build gatecheck binary
build:
mkdir -p bin
go build -ldflags="-X 'main.cliVersion=$(git describe --tags)' -X 'main.gitCommit=$(git rev-parse HEAD)' -X 'main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)' -X 'main.gitDescription=$(git log -1 --pretty=%B)'" -o ./bin ./cmd/gatecheck
# build and install binary
install: build
cp ./bin/gatecheck {{ INSTALL_DIR }}/gatecheck
# unit testing with coverage
test:
go test -cover ./...
# golangci-lint view only
lint:
golangci-lint run --fast
# golangci-lint fix linting errors and format if possible
fix:
golangci-lint run --fast --fix
release-snapshot:
goreleaser release --snapshot --rm-dist
release:
goreleaser release --rm-dist
upgrade:
git status --porcelain | grep -q . && echo "Repository is dirty, commit changes before upgrading." && exit 1 || exit 0
go get -u ./...
go mod tidy
# Locally serve documentation
serve-docs:
mdbook serve