Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1137 from adrianludwin/krew-05
Browse files Browse the repository at this point in the history
Build Krew archive
  • Loading branch information
k8s-ci-robot authored Sep 23, 2020
2 parents 3ac6a10 + 8e92389 commit 6463d86
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 23 deletions.
17 changes: 17 additions & 0 deletions incubator/hnc/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ steps:
# Build plugin
GOOS=linux GOARCH=amd64 go build -o kubectl-hns_linux_amd64 ../cmd/kubectl/main.go
GOOS=darwin GOARCH=amd64 go build -o kubectl-hns_darwin_amd64 ../cmd/kubectl/main.go
mkdir kubectl
cp kubectl-hns_linux_amd64 kubectl/
cp kubectl-hns_darwin_amd64 kubectl/
cp ../LICENSE kubectl/
tar czvf kubectl-hns.tar.gz kubectl/
# Upload manifest
- name: gcr.io/cloud-builders/curl
args:
Expand Down Expand Up @@ -68,6 +73,18 @@ steps:
- '-u'
- '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN'
- 'https://uploads.github.com/repos/kubernetes-sigs/multi-tenancy/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_darwin_amd64'
# Upload plugin (Krew tar file)
- name: gcr.io/cloud-builders/curl
args:
- '-X'
- 'POST'
- '-H'
- 'Content-Type: application/x-application'
- '--data-binary'
- '@multi-tenancy/incubator/hnc/out/kubectl-hns.tar.gz'
- '-u'
- '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN'
- 'https://uploads.github.com/repos/kubernetes-sigs/multi-tenancy/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns.tar.gz'
# Build Docker image
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/$PROJECT_ID/hnc/controller:$_HNC_IMG_TAG', 'multi-tenancy/incubator/hnc']
Expand Down
23 changes: 0 additions & 23 deletions incubator/hnc/hack/krew-hierarchical-namespaces.yaml

This file was deleted.

39 changes: 39 additions & 0 deletions incubator/hnc/hack/krew-kubectl-hns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### WARNING ###
# In v0.5, we don't have any automation to fill in the variables shown below
# (HNC_RELEASE_REPO_OWNER, HNC_IMG_TAG, HNC_KreW_TAR_SHA256). You must fill
# these in by hand. This is all automated in v0.6+.
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: hns
spec:
shortDescription: Manage hierarchical namespaces (part of HNC)
description: |
Manipulates hierarchical namespaces provided by the Hierarchical Namespace Controller (HNC).
version: HNC_IMG_TAG
homepage: https://github.com/HNC_RELEASE_REPO_OWNER/multi-tenancy/tree/master/incubator/hnc/docs/user-guide
platforms:
- uri: https://github.com/HNC_RELEASE_REPO_OWNER/multi-tenancy/releases/download/hnc-HNC_IMG_TAG/kubectl-hns.tar.gz
selector:
matchLabels:
os: linux
arch: amd64
sha256: HNC_KREW_TAR_SHA256
files:
- from: "bin/kubectl/kubectl-hns_linux_amd64"
to: "."
- from: "bin/kubectl/LICENSE"
to: "."
bin: "./kubectl-hns_linux_amd64"
- uri: https://github.com/HNC_RELEASE_REPO_OWNER/multi-tenancy/releases/download/hnc-HNC_IMG_TAG/kubectl-hns.tar.gz
selector:
matchLabels:
os: darwin
arch: amd64
sha256: HNC_KREW_TAR_SHA256
files:
- from: "bin/kubectl/kubectl-hns_darwin_amd64"
to: "."
- from: "bin/kubectl/LICENSE"
to: "."
bin: "./kubectl-hns_darwin_amd64"

0 comments on commit 6463d86

Please sign in to comment.