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

Commit 6463d86

Browse files
authored
Merge pull request #1137 from adrianludwin/krew-05
Build Krew archive
2 parents 3ac6a10 + 8e92389 commit 6463d86

File tree

3 files changed

+56
-23
lines changed

3 files changed

+56
-23
lines changed

incubator/hnc/cloudbuild.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ steps:
3232
# Build plugin
3333
GOOS=linux GOARCH=amd64 go build -o kubectl-hns_linux_amd64 ../cmd/kubectl/main.go
3434
GOOS=darwin GOARCH=amd64 go build -o kubectl-hns_darwin_amd64 ../cmd/kubectl/main.go
35+
mkdir kubectl
36+
cp kubectl-hns_linux_amd64 kubectl/
37+
cp kubectl-hns_darwin_amd64 kubectl/
38+
cp ../LICENSE kubectl/
39+
tar czvf kubectl-hns.tar.gz kubectl/
3540
# Upload manifest
3641
- name: gcr.io/cloud-builders/curl
3742
args:
@@ -68,6 +73,18 @@ steps:
6873
- '-u'
6974
- '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN'
7075
- 'https://uploads.github.com/repos/kubernetes-sigs/multi-tenancy/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_darwin_amd64'
76+
# Upload plugin (Krew tar file)
77+
- name: gcr.io/cloud-builders/curl
78+
args:
79+
- '-X'
80+
- 'POST'
81+
- '-H'
82+
- 'Content-Type: application/x-application'
83+
- '--data-binary'
84+
- '@multi-tenancy/incubator/hnc/out/kubectl-hns.tar.gz'
85+
- '-u'
86+
- '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN'
87+
- 'https://uploads.github.com/repos/kubernetes-sigs/multi-tenancy/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns.tar.gz'
7188
# Build Docker image
7289
- name: gcr.io/cloud-builders/docker
7390
args: ['build', '-t', 'gcr.io/$PROJECT_ID/hnc/controller:$_HNC_IMG_TAG', 'multi-tenancy/incubator/hnc']

incubator/hnc/hack/krew-hierarchical-namespaces.yaml

-23
This file was deleted.
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
### WARNING ###
2+
# In v0.5, we don't have any automation to fill in the variables shown below
3+
# (HNC_RELEASE_REPO_OWNER, HNC_IMG_TAG, HNC_KreW_TAR_SHA256). You must fill
4+
# these in by hand. This is all automated in v0.6+.
5+
apiVersion: krew.googlecontainertools.github.com/v1alpha2
6+
kind: Plugin
7+
metadata:
8+
name: hns
9+
spec:
10+
shortDescription: Manage hierarchical namespaces (part of HNC)
11+
description: |
12+
Manipulates hierarchical namespaces provided by the Hierarchical Namespace Controller (HNC).
13+
version: HNC_IMG_TAG
14+
homepage: https://github.com/HNC_RELEASE_REPO_OWNER/multi-tenancy/tree/master/incubator/hnc/docs/user-guide
15+
platforms:
16+
- uri: https://github.com/HNC_RELEASE_REPO_OWNER/multi-tenancy/releases/download/hnc-HNC_IMG_TAG/kubectl-hns.tar.gz
17+
selector:
18+
matchLabels:
19+
os: linux
20+
arch: amd64
21+
sha256: HNC_KREW_TAR_SHA256
22+
files:
23+
- from: "bin/kubectl/kubectl-hns_linux_amd64"
24+
to: "."
25+
- from: "bin/kubectl/LICENSE"
26+
to: "."
27+
bin: "./kubectl-hns_linux_amd64"
28+
- uri: https://github.com/HNC_RELEASE_REPO_OWNER/multi-tenancy/releases/download/hnc-HNC_IMG_TAG/kubectl-hns.tar.gz
29+
selector:
30+
matchLabels:
31+
os: darwin
32+
arch: amd64
33+
sha256: HNC_KREW_TAR_SHA256
34+
files:
35+
- from: "bin/kubectl/kubectl-hns_darwin_amd64"
36+
to: "."
37+
- from: "bin/kubectl/LICENSE"
38+
to: "."
39+
bin: "./kubectl-hns_darwin_amd64"

0 commit comments

Comments
 (0)