-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjustfile
35 lines (27 loc) · 944 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
bin := "nv"
# Run Aqua Security’s Trivy to catch possible vulnerabilities in the codebase
@audit:
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v {{justfile_directory()}}:/path aquasec/trivy fs --scanners config,secret,vuln /path
# Build nv’s executable
@build $GO_ENABLED="0": clean
go mod download && go mod verify
go build -ldflags="-w -s" -v -x -o {{bin}} ./cmd/nv
# Delete nv’s executable
@clean:
rm -f {{bin}}
# Update dependencies
@go-mod-update:
go get -d -u ./...
go mod tidy
# Dry-run GoReleaser
@release-dry-run:
goreleaser --snapshot --skip=publish --clean
# Launch the executable with optional arguments
@run *ARGS:
go run ./cmd/nv/nv.go {{ARGS}}
# Git tag a version
@tag VERSION:
git tag -a {{VERSION}} -s -m "{{VERSION}}"
# Run unit tests
@test:
go test -v -cover ./... | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/''