Skip to content

Commit ec5826a

Browse files
committed
Move CLI to thv directory again
This simplifies installting via `go install` Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
1 parent 369bde2 commit ec5826a

19 files changed

+8
-8
lines changed

.github/workflows/image-build-and-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Build and Push Image to GHCR
5353
run: |
5454
TAG=$(echo "${{ steps.version-string.outputs.tag }}" | sed 's/+/_/g')
55-
KO_DOCKER_REPO=$BASE_REPO ko build --platform=linux/amd64,linux/arm64 --bare -t $TAG ./cmd \
55+
KO_DOCKER_REPO=$BASE_REPO ko build --platform=linux/amd64,linux/arm64 --bare -t $TAG ./cmd/thv \
5656
--image-label=org.opencontainers.image.source=https://github.com/StacklokLabs/toolhive,org.opencontainers.image.title="toolhive",org.opencontainers.image.vendor=Stacklok
5757
5858
- name: Sign Image with Cosign

Taskfile.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ tasks:
4343
sh: date -u +"%Y-%m-%dT%H:%M:%SZ"
4444
cmds:
4545
- 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
4747

4848
install:
4949
desc: Install the thv binary to GOPATH/bin
@@ -55,7 +55,7 @@ tasks:
5555
BUILD_DATE:
5656
sh: date -u +"%Y-%m-%dT%H:%M:%SZ"
5757
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
5959

6060
all:
6161
desc: Run linting, tests, and build
@@ -68,13 +68,13 @@ tasks:
6868
build-image:
6969
desc: Build the image with ko
7070
cmds:
71-
- ko build --platform linux/amd64,linux/arm64 --local ./cmd
71+
- ko build --platform linux/amd64,linux/arm64 --local ./cmd/thv
7272

7373
test-k8s-apply:
7474
desc: Builds the image, loads it into kind, and applies the Kubernetes manifests
7575
vars:
7676
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
7878
cmds:
7979
# gets the local kind kubeconfig
8080
- kind get kubeconfig > kconfig.yaml
@@ -93,4 +93,4 @@ tasks:
9393
- kubectl apply -f deploy/k8s/ingress.yaml --kubeconfig kconfig.yaml
9494
# 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
9595
- 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

cmd/help/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/spf13/cobra"
99
"github.com/spf13/cobra/doc"
1010

11-
cli "github.com/StacklokLabs/toolhive/cmd/thv"
11+
cli "github.com/StacklokLabs/toolhive/cmd/thv/app"
1212
)
1313

1414
func main() {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)