From 6b785b8ee74971d007a3e68e2362a1fc25b7470a Mon Sep 17 00:00:00 2001 From: Yuvraj Date: Fri, 15 May 2020 07:21:35 -0700 Subject: [PATCH] krew and goreleaser template added --- .goreleaser.yml | 61 ++++++++++++++++++++++++++-------------------- .krew/kyverno.yaml | 25 +++++++++++++++++++ 2 files changed, 59 insertions(+), 27 deletions(-) create mode 100644 .krew/kyverno.yaml diff --git a/.goreleaser.yml b/.goreleaser.yml index 426f085209..c29f5e4c23 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,36 +1,43 @@ project_name: kyverno -release: - github: - owner: kyverno - name: kyverno +before: + hooks: + - go mod download builds: - - id: kyverno - goos: +- id: kyverno + main: cmd/cli/kubectl-kyverno/main.go + binary: kyverno + env: + - CGO_ENABLED=0 + goos: - linux - - windows - darwin - goarch: + - windows + goarch: - amd64 - - "386" - env: - - CGO_ENABLED=0 - - GO111MODULE=on - main: cmd/cli/kubectl-kyverno/main.go - ldflags: -s -w - -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 }} -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}" + - arm + - arm64 + goarm: [6, 7] archives: - - id: kyverno - builds: +- id: kyverno-archive + name_template: |- + kyverno_{{ .Tag }}_{{ .Os }}_{{ .Arch -}} + {{- with .Arm -}} + {{- if (eq . "6") -}}hf + {{- else -}}v{{- . -}} + {{- end -}} + {{- end -}} + builds: - kyverno - name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" - format_overrides: + replacements: + 386: i386 + amd64: x86_64 + format_overrides: - goos: windows format: zip - files: - - LICENSE + files: ["LICENSE"] +checksum: + name_template: "checksums.txt" + algorithm: sha256 +release: + extra_files: + - glob: ./kyverno \ No newline at end of file diff --git a/.krew/kyverno.yaml b/.krew/kyverno.yaml new file mode 100644 index 0000000000..560e138122 --- /dev/null +++ b/.krew/kyverno.yaml @@ -0,0 +1,25 @@ +apiVersion: kyverno.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: kyverno +spec: + homepage: https://github.com/nirmata/kyverno + shortDescription: Kubernetes Native Policy Management + version: {{ .TagName }} + description: | + Kyverno can be used to scan existing workloads for best practices, or can be used to enforce best practices by blocking or mutating API requests.Kyverno allows cluster adminstrators to manage environment specific configurations independently of workload configurations and enforce configuration best practices for their clusters. + platforms: + - selector: + matchExpressions: + - key: os + operator: In + values: + - darwin + - linux + {{addURIAndSha "https://github.com/nirmata/kyverno/archive/{{ .TagName }}.tar.gz" .TagName }} + bin: kyverno + files: + - from: kyverno-*/kyverno + to: . + - from: kyverno-*/LICENSE + to: . \ No newline at end of file