43
43
sh : date -u +"%Y-%m-%dT%H:%M:%SZ"
44
44
cmds :
45
45
- mkdir -p bin
46
- - go build -ldflags "-s -w -X github.com/StacklokLabs/toolhive/cmd/thv.Version={{.VERSION}} -X github.com/StacklokLabs/toolhive/cmd/thv.Commit={{.COMMIT}} -X github.com/StacklokLabs/toolhive/cmd/thv.BuildDate={{.BUILD_DATE}}" -o bin/thv ./cmd
46
+ - go build -ldflags "-s -w -X github.com/StacklokLabs/toolhive/cmd/thv/app .Version={{.VERSION}} -X github.com/StacklokLabs/toolhive/cmd/thv/app .Commit={{.COMMIT}} -X github.com/StacklokLabs/toolhive/cmd/thv/app .BuildDate={{.BUILD_DATE}}" -o bin/thv ./cmd/thv
47
47
48
48
install :
49
49
desc : Install the thv binary to GOPATH/bin
55
55
BUILD_DATE :
56
56
sh : date -u +"%Y-%m-%dT%H:%M:%SZ"
57
57
cmds :
58
- - go install -ldflags "-s -w -X github.com/StacklokLabs/toolhive/cmd/thv.Version={{.VERSION}} -X github.com/StacklokLabs/toolhive/cmd/thv.Commit={{.COMMIT}} -X github.com/StacklokLabs/toolhive/cmd/thv.BuildDate={{.BUILD_DATE}}" -v ./cmd
58
+ - go install -ldflags "-s -w -X github.com/StacklokLabs/toolhive/cmd/thv/app .Version={{.VERSION}} -X github.com/StacklokLabs/toolhive/cmd/thv/app .Commit={{.COMMIT}} -X github.com/StacklokLabs/toolhive/cmd/thv/app .BuildDate={{.BUILD_DATE}}" -v ./cmd/thv
59
59
60
60
all :
61
61
desc : Run linting, tests, and build
@@ -68,13 +68,13 @@ tasks:
68
68
build-image :
69
69
desc : Build the image with ko
70
70
cmds :
71
- - ko build --platform linux/amd64,linux/arm64 --local ./cmd
71
+ - ko build --platform linux/amd64,linux/arm64 --local ./cmd/thv
72
72
73
73
test-k8s-apply :
74
74
desc : Builds the image, loads it into kind, and applies the Kubernetes manifests
75
75
vars :
76
76
IMAGE :
77
- sh : ko build --platform linux/amd64 --local -B ./cmd | tail -n 1
77
+ sh : ko build --platform linux/amd64 --local -B ./cmd/thv | tail -n 1
78
78
cmds :
79
79
# gets the local kind kubeconfig
80
80
- kind get kubeconfig > kconfig.yaml
93
93
- kubectl apply -f deploy/k8s/ingress.yaml --kubeconfig kconfig.yaml
94
94
# We do the below commands because of some inconsistency between the secret and webhook caBundle. ref: https://github.com/kubernetes/ingress-nginx/issues/5968#issuecomment-849772666
95
95
- CA=$(kubectl -n ingress-nginx get secret ingress-nginx-admission -ojsonpath='{.data.ca}' --kubeconfig kconfig.yaml)
96
- - kubectl patch validatingwebhookconfigurations ingress-nginx-admission --type='json' --patch='[{"op":"add","path":"/webhooks/0/clientConfig/caBundle","value":"'$CA'"}]' --kubeconfig kconfig.yaml
96
+ - kubectl patch validatingwebhookconfigurations ingress-nginx-admission --type='json' --patch='[{"op":"add","path":"/webhooks/0/clientConfig/caBundle","value":"'$CA'"}]' --kubeconfig kconfig.yaml
0 commit comments