Skip to content

Commit

Permalink
remove arm from goreleaser (kyverno#903)
Browse files Browse the repository at this point in the history
* Feature : Added complete release cycle and created install bash script for kyverno-cli
  • Loading branch information
yindia authored Jun 4, 2020
1 parent b951de2 commit d5ea041
Show file tree
Hide file tree
Showing 10 changed files with 496 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ratings:

exclude_paths:
- documentation/
- charts
- definitions
- gh-pages
- samples
- scripts
- scripts
50 changes: 50 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Related issue

<!--
Please link the GitHub issue this pull request resolves in the format of `#1234`. If you discussed this change
with a maintainer, please mention her/him using the `@` syntax (e.g. `@JimBugwadia`).
If this change neither resolves an existing issue nor has sign-off from one of the maintainers, there is a
chance substantial changes will be requested or that the changes will be rejected.
You can discuss changes with maintainers in the [Kyvrno Slack Channel](https://kubernetes.slack.com/).
-->

**What type of PR is this?**
<!--
> Uncomment only one ` /kind <>` line, hit enter to put that in a new line, and remove leading whitespaces from that line:
>
> /kind api-change
> /kind bug
> /kind cleanup
> /kind design
> /kind documentation
> /kind failing-test
> /kind feature
-->

## Proposed changes

<!--
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
-->

## Checklist

<!--
Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
-->

- [ ] I have read the [contributing guidelines](../blob/master/CONTRIBUTING.md).
- [ ] I have added tests that prove my fix is effective or that my feature
works.
- [ ] I have added or changed [the documentation](documentation/).

## Further comments

<!--
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution
you did and what alternatives you considered, etc...
-->
21 changes: 0 additions & 21 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

17 changes: 17 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
titleOnly: true
commitsOnly: false
titleAndCommits: false

types:
- feat
- fix
- revert
- docs
- style
- refactor
- test
- build
- autogen
- security
- ci
- chore
4 changes: 4 additions & 0 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
run: |
mkdir -p output/helm-charts/
helm package charts/kyverno/ -d output/helm-charts/
- name: Reindex repo
run: |
wget --quiet ${{ env.HELM_CHART_URL }}/index.yaml
helm repo index --merge index.yaml --url ${{ env.HELM_CHART_URL }} output/helm-charts/
- name: Release
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.14
- uses: azure/docker-login@v1
with:
login-server: index.docker.io
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand All @@ -28,4 +33,5 @@ jobs:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- uses: creekorful/[email protected]

78 changes: 70 additions & 8 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
project_name: kyverno
project_name: kyverno-cli
before:
hooks:
- go mod download
builds:
- id: kyverno
- id: kyverno-cli
main: cmd/cli/kubectl-kyverno/main.go
binary: kyverno
binary: kyverno-cli
env:
- CGO_ENABLED=0
goos:
Expand All @@ -14,20 +14,36 @@ builds:
- windows
goarch:
- amd64
- arm
- arm64
goarm: [6, 7]
- id: kyverno
main: cmd/kyverno/main.go
binary: kyverno
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- id: kyvernopre
main: cmd/initContainer/main.go
binary: kyvernopre
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
archives:
- id: kyverno-archive
- id: kyverno-cli-archive
name_template: |-
kyverno_{{ .Tag }}_{{ .Os }}_{{ .Arch -}}
kyverno-cli_{{ .Tag }}_{{ .Os }}_{{ .Arch -}}
{{- with .Arm -}}
{{- if (eq . "6") -}}hf
{{- else -}}v{{- . -}}
{{- end -}}
{{- end -}}
builds:
- kyverno
- kyverno-cli
replacements:
386: i386
amd64: x86_64
Expand All @@ -40,3 +56,49 @@ checksum:
algorithm: sha256
release:
prerelease: auto
changelog:
sort: asc
filters:
# commit messages matching the regexp listed here will be removed from
# the changelog
exclude:
- '^docs:'
- typo
brews:
- github:
owner: nirmata
name: homebrew-kyverno-cli
goarm: 6
ids:
- kyverno-cli-archive
homepage: https://www.kyverno.io
commit_author:
name: kyverno
email: [email protected]
scoop:
bucket:
owner: nirmata
name: scoop-kyverno-cli
homepage: https://www.kyverno.io
commit_author:
name: kyverno
email: [email protected]
dockers:
- dockerfile: ./cmd/initContainer/Dockerfile
binaries:
- kyvernopre
image_templates:
- "nirmata/kyvernopre:v{{ .Major }}"
- "nirmata/kyvernopre:v{{ .Major }}.{{ .Minor }}"
- "nirmata/kyvernopre:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "nirmata/kyvernopre:{{ .Tag }}"
- "nirmata/kyvernopre:latest"
- dockerfile: ./cmd/kyverno/Dockerfile
binaries:
- kyverno
image_templates:
- "nirmata/kyverno:v{{ .Major }}"
- "nirmata/kyverno:v{{ .Major }}.{{ .Minor }}"
- "nirmata/kyverno:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "nirmata/kyverno:{{ .Tag }}"
- "nirmata/kyverno:latest"
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,7 @@ code-cov-report: $(CODE_COVERAGE_FILE_TXT)
# transform to html format
@echo " generating code coverage report"
go tool cover -html=coverage.txt
if [ -a $(CODE_COVERAGE_FILE_HTML) ]; then open $(CODE_COVERAGE_FILE_HTML); fi;
if [ -a $(CODE_COVERAGE_FILE_HTML) ]; then open $(CODE_COVERAGE_FILE_HTML); fi;

godownloader:
godownloader .goreleaser.yml --repo nirmata/kyverno -o ./scripts/install-cli.sh --source="raw"
6 changes: 6 additions & 0 deletions documentation/kyverno-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ make cli
mv ./cmd/cli/kubectl-kyverno/kyverno /usr/local/bin/kyverno
```

You can also use curl to install kyverno-cli

```bash
curl -L https://raw.githubusercontent.com/nirmata/kyverno/master/scripts/install-cli.sh | bash
```

## Install via AUR (archlinux)

You can install the kyverno cli via your favourite AUR helper (e.g. [yay](https://github.com/Jguer/yay))
Expand Down
Loading

0 comments on commit d5ea041

Please sign in to comment.