-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
34 lines (25 loc) · 890 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
BUILD_PATH := "./build"
BIN_NAME := "hckctl"
GO_BUILD_ENV := "CGO_ENABLED=0"
GO_FILES := "./..."
default: (build BUILD_PATH)
install:
go mod tidy
#go mod vendor
update:
go get -u ./...
format:
go fmt {{GO_FILES}}
vet:
go vet {{GO_FILES}}
test:
go test {{GO_FILES}} -v -timeout 30s -cover
build output $VERSION_COMMIT="$(git rev-parse HEAD)" $VERSION_TIMESTAMP="$(date -u +%Y-%m-%dT%H:%M:%SZ)": install format vet test
rm -frv {{output}}
{{GO_BUILD_ENV}} go build -ldflags="\
-X github.com/hckops/hckctl/internal/command/version.release=0.0.0 \
-X github.com/hckops/hckctl/internal/command/version.commit={{VERSION_COMMIT}} \
-X github.com/hckops/hckctl/internal/command/version.timestamp={{VERSION_TIMESTAMP}}" \
-o {{output}}/{{BIN_NAME}} internal/main.go
publish version:
GOPROXY=proxy.golang.org go list -m github.com/hckops/hckctl@v{{version}}