Skip to content
bot to bump version of plugin in krew-index on new releases
Go Dockerfile Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows release binary too Feb 1, 2020
cmd add example in readme file, and improve logging Jan 30, 2020
examples prepare for version v0.0.36 Feb 3, 2020
pkg use token if provided Feb 3, 2020
vendor add subcommand template for testing template files Jan 30, 2020
.gitignore Update .gitignore Dec 1, 2019
.goreleaser.yml release binary too Feb 1, 2020
LICENSE first commit Nov 30, 2019
README.md prepare for version v0.0.36 Feb 3, 2020
action.Dockerfile
action.yml prepare for version v0.0.36 Feb 3, 2020
build-and-push.sh create separate bins for webhook and action Jan 13, 2020
go.mod add subcommand template for testing template files Jan 30, 2020
go.sum run go mod tidy Feb 1, 2020
template.sh add subcommand template for testing template files Jan 30, 2020
update-deps.sh change Dec 1, 2019
update-krew-index.sh Create update-krew-index.sh Feb 4, 2020
webhook.Dockerfile run tests when building docker images Feb 1, 2020

README.md

krew-release-bot is a bot that automates the update of plugin manifests in krew-index when a new version of your kubectl plugin is released.

To trigger krew-release-bot you can use a github-action which sends the event to the bot.

Basic Setup

  • Make sure you have enabled github actions for your repo
  • Add a .krew.yaml template file at the root of your repo. Refer to kubectl-evict-pod repo for an example.
  • To setup the action, add the following snippet after the step that publishes the new release and assets:
    - name: Update new version in krew-index
      uses: rajatjindal/krew-release-bot@v0.0.36
    Check out the goreleaser example below for details.
Example when using go-releaser

<your-git-root>/.github/workflows/release.yml

name: release
on:
  push:
    tags:
    - 'v*.*.*'
jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@master
    - name: Setup Go
      uses: actions/setup-go@v1
      with:
        go-version: 1.13
    - name: GoReleaser
      uses: goreleaser/goreleaser-action@v1
      with:
        version: latest
        args: release --rm-dist
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - name: Update new version in krew-index
      uses: rajatjindal/krew-release-bot@v0.0.36

** You can also customize the release assets names, platforms for which build is done using .goreleaser.yml file in root of your git repo.

Examples using krew-release-bot in different ways

Testing the template file

You can test the template file rendering before check-in to the repo by running following command

$ docker run -v /path/to/your/template-file.yaml:/tmp/template-file.yaml rajatjindal/krew-release-bot:v0.0.36 \
  krew-release-bot template --tag <tag-name> --template-file /tmp/template-file.yaml

Inputs for the action

Key Default Value Description
workdir env.GITHUB_WORKSPACE Overrides the GitHub workspace directory path
krew_template_file .krew.yaml The path to template file relative to $workdir. e.g. templates/misc/plugin-name.yaml

Limitations of krew-release-bot

  • only works for repos hosted on github right now
  • only supports one plugin per git repo right now
  • The first version of plugin has to be submitted manually, by plugin author, to the krew-index repo
  • The homepage in the plugin spec in krew-index is used to establish ownership. The repo from which the release is published should be the homepage of the plugin in already released plugin-spec.

Kubernetes CLA

krew-release-bot is just a service to open PR on your behalf to release a new version of the krew-plugin. Your CLA agreement (that you did when submitting the new plugin to krew-index) is still applicable on these PR's.

You can’t perform that action at this time.