-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
31 lines (23 loc) · 1.05 KB
/
justfile
File metadata and controls
31 lines (23 loc) · 1.05 KB
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
INSTALL_DIR := env('INSTALL_DIR', '/usr/local/bin')
# build gatecheck binary
build:
mkdir -p bin
go build -ldflags="-X 'main.cliVersion=$(git describe --tags || echo "")' -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/deploykit ./cmd/deploykit
build-image image-name:
docker build --file Dockerfile --tag {{ image-name }} --build-arg VERSION=$(git describe --tags || echo "") --build-arg GIT_COMMIT=$(git rev-parse HEAD) --build-arg BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) --build-arg "GIT_DESCRIPTION=$(git log -1 --pretty=%B)" .
# build and install binary
install: build
cp ./bin/deploykit {{ INSTALL_DIR }}/deploykit
# 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 --clean
release:
goreleaser release --clean