From 225c8a79ad1be2b1d0360402bb578b8e43f8c681 Mon Sep 17 00:00:00 2001 From: Yuvraj Date: Wed, 29 Apr 2020 10:38:21 -0700 Subject: [PATCH] krew setup --- .github/main.workflow | 18 ++++++++++++++ .goreleaser.yml | 12 +++++---- deploy/krew/plugin.yaml | 54 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 deploy/krew/plugin.yaml diff --git a/.github/main.workflow b/.github/main.workflow index e69de29bb2..47d35f9357 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -0,0 +1,18 @@ +workflow "Release" { + on = "push" + resolves = ["goreleaser"] +} + +action "is-tag" { + uses = "actions/bin/filter@master" + args = "tag" +} + +action "goreleaser" { + uses = "docker://goreleaser/goreleaser" + secrets = [ + "GITHUB_TOKEN", + ] + args = "release" + needs = ["is-tag"] +} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 9bab596f93..37b7d11745 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,7 @@ project_name: kyverno release: github: - owner: nirmata + owner: kyverno name: kyverno builds: - id: kyverno @@ -17,10 +17,12 @@ builds: - GO111MODULE=on main: cmd/cli/kubectl-kyverno/main.go ldflags: -s -w - -X github.com/nirmata/kyverno /pkg/version.BuildVersion={{ .Version }} - -X github.com/nirmata/kyverno /pkg/version.BuildHash={{ .FullCommit }} - -X github.com/nirmata/kyverno /pkg/version.BuildTime={{ .Timestamp }} + -X github.com/kyverno/kyverno/pkg/version.BuildVersion={{ .Version }} + -X github.com/kyverno/kyverno/pkg/version.BuildHash={{ .FullCommit }} + -X github.com/kyverno/kyverno/pkg/version.BuildTime={{ .Timestamp }} archives: -- format_overrides: + - id: kyverno + name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" + format_overrides: - goos: windows format: zip \ No newline at end of file diff --git a/deploy/krew/plugin.yaml b/deploy/krew/plugin.yaml new file mode 100644 index 0000000000..2e80223133 --- /dev/null +++ b/deploy/krew/plugin.yaml @@ -0,0 +1,54 @@ +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: kyverno +spec: + version: "v0.0.1" + platforms: + - selector: + matchLabels: + os: linux + arch: amd64 + uri: https://github.com/nirmata/kyverno/releases/download/v0.1.0/kyverno_linux_amd64.tar.gz + sha256: "" + files: + - from: "./kyverno" + to: "." + - from: LICENSE + to: "." + bin: "kyverno" + - selector: + matchLabels: + os: darwin + arch: amd64 + uri: https://github.com/nirmata/kyverno/releases/download/v0.0.1/kyverno_darwin_amd64.tar.gz + sha256: "" + files: + - from: "./kyverno" + to: "." + - from: LICENSE + to: "." + bin: "kyverno" + - selector: + matchLabels: + os: windows + arch: amd64 + uri: https://github.com/nirmata/kyverno/releases/download/v0.1.0/kyverno_windows_amd64.zip + sha256: "" + files: + - from: "/kyverno.exe" + to: "." + - from: LICENSE + to: "." + bin: "kyverno.exe" + shortDescription: A new plugin + homepage: https://github.com/nirmata/kyverno + caveats: | + Usage: + $ kubectl kyverno + For additional options: + $ kubectl kyverno --help + or https://github.com/nirmata/kyverno/blob/v0.1.0/doc/USAGE.md + description: | + This is a new plugin +