From a755bb473b24195f88e8633fb7539e5dd0e9acc7 Mon Sep 17 00:00:00 2001 From: Olli Janatuinen Date: Fri, 10 Sep 2021 06:57:47 +0000 Subject: [PATCH] add windows amd64 cli --- Makefile | 4 ++++ cloudbuild.yaml | 12 ++++++++++++ hack/krew-kubectl-hns.yaml | 12 ++++++++++++ 3 files changed, 28 insertions(+) diff --git a/Makefile b/Makefile index 9b15fd40b..c45880b34 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,10 @@ build: generate fmt vet manifests -o bin/kubectl/kubectl-hns_linux_arm \ -ldflags="-X sigs.k8s.io/hierarchical-namespaces/internal/version.Version=${HNC_IMG_TAG}" \ ./cmd/kubectl/main.go + GOOS=windows GOARCH=amd64 go build \ + -o bin/kubectl/kubectl-hns_windows_amd64.exe \ + -ldflags="-X sigs.k8s.io/hierarchical-namespaces/internal/version.Version=${HNC_IMG_TAG}" \ + ./cmd/kubectl/main.go # Clean all binaries (manager and kubectl) clean: krew-uninstall diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 2410f4072..da7ac0b77 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -63,6 +63,18 @@ steps: - '-u' - '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN' - 'https://uploads.github.com/repos/$_HNC_REPO_OWNER/hierarchical-namespaces/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_darwin_amd64' +# Upload plugin (Windows) +- name: gcr.io/cloud-builders/curl + args: + - '-X' + - 'POST' + - '-H' + - 'Content-Type: application/x-application' + - '--data-binary' + - '@hierarchical-namespaces/bin/kubectl/kubectl-hns_windows_amd64.exe' + - '-u' + - '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN' + - 'https://uploads.github.com/repos/$_HNC_REPO_OWNER/hierarchical-namespaces/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_windows_amd64.exe' # Upload plugin (Krew tar file) - name: gcr.io/cloud-builders/curl args: diff --git a/hack/krew-kubectl-hns.yaml b/hack/krew-kubectl-hns.yaml index 769847289..0cd006d67 100644 --- a/hack/krew-kubectl-hns.yaml +++ b/hack/krew-kubectl-hns.yaml @@ -58,3 +58,15 @@ spec: - from: "bin/kubectl/LICENSE" to: "." bin: "./kubectl-hns_darwin_amd64" + - uri: https://github.com/HNC_RELEASE_REPO_OWNER/hierarchical-namespaces/releases/download/hnc-HNC_IMG_TAG/kubectl-hns.tar.gz + selector: + matchLabels: + os: windows + arch: amd64 + sha256: HNC_KREW_TAR_SHA256 + files: + - from: "bin/kubectl/kubectl-hns_windows_amd64.exe" + to: "." + - from: "bin/kubectl/LICENSE" + to: "." + bin: "./kubectl-hns_windows_amd64.exe"