Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/annabarnes1138/yet-another-chart-releaser
Hosting Helm Charts via GitHub Pages and Releases
https://github.com/annabarnes1138/yet-another-chart-releaser
charts github-pages helm hosting kubernetes repository
Last synced: 12 days ago
JSON representation
Hosting Helm Charts via GitHub Pages and Releases
- Host: GitHub
- URL: https://github.com/annabarnes1138/yet-another-chart-releaser
- Owner: annabarnes1138
- License: apache-2.0
- Created: 2021-04-23T17:16:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-26T17:47:12.000Z (over 3 years ago)
- Last Synced: 2024-08-01T18:27:24.853Z (3 months ago)
- Topics: charts, github-pages, helm, hosting, kubernetes, repository
- Language: Go
- Homepage:
- Size: 256 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
Yet Another Helm Chart ReleaserBe sure to :star: this repo so that you can keep up to date on any progress!
yacr (pronounced like yacker) is a tool designed to help GitHub repos self-host their own chart repos by adding Helm chart artifacts to GitHub Releases named for the chart version and then creating an `index.yaml` file for those releases that can be hosted on GitHub Pages (or elsewhere!).This repo is for the cli tool itself. If you are looking for a GitHub Action to add this tool to your workflow, it can be found at stecky/yet-another-chart-releaser-action or on the GitHub Marketplace
This repo is a clone of helm/chart-releaser. 99% of the credit for this project goes to their team for the great work they did on chart-releaser. I simply needed some additional functionality and decided to create my own clone of it. If you want to see a list of enhancements that I plan to make, check out the goals section of this readme.
## Installation
### Binaries (recommended)
Download your preferred asset from the [releases page](https://github.com/stecky/yet-another-chart-releaser/releases) and install manually.
### Homebrew
```console
$ brew tap stecky/tap
$ brew install yet-another-chart-releaser
```### Go get (for contributing)
```console
$ # clone repo to some directory outside GOPATH
$ git clone https://github.com/stecky/yet-another-chart-releaser
$ cd yet-another-chart-releaser
$ go mod download
$ go install ./...
```### Docker (for Continuous Integration)
Docker images are pushed to the [stecky/yet-another-chart-releaser](https://hub.docker.com/r/stecky/yet-another-chart-releaser/tags?page=1&ordering=last_updated) dockerhub registry. The Docker image is built on top of Alpine and its default entry-point is `yacr`. See the [Dockerfile](./Dockerfile) for more details.
## Usage
Currently, `yacr` can create GitHub Releases from a set of charts packaged up into a directory and create an `index.yaml` file for the chart repository from GitHub Releases.
```console
$ yacr --help
Create Helm chart repositories on GitHub Pages by uploading Chart packages
and Chart metadata to GitHub Releases and creating a suitable index fileUsage:
yacr [command]Available Commands:
help Help about any command
index Update Helm repo index.yaml for the given GitHub repo
upload Upload Helm chart packages to GitHub Releases
package Package Helm charts
version Print version informationFlags:
--config string Config file (default is $HOME/.yacr.yaml)
-h, --help help for yacrUse "yacr [command] --help" for more information about a command.
```### Create Helm Chart Packages from Helm Charts
Scans a path for Helm charts and creates packages.
```console
$ yacr package --help
This command packages a chart into a versioned chart archive file. If a path
is given, this will look at that path for a chart (which must contain a
Chart.yaml file) and then package that directory.If you wish to use advanced packaging options such as creating signed
packages or updating chart dependencies please use "helm package" instead.Usage:
yacr package [CHART_PATH] [...] [flags]Flags:
-h, --help help for package
--key string Name of the key to use when signing
--keyring string Location of a public keyring (default "/Users/steven.barnes/.gnupg/pubring.gpg")
-p, --package-path string Path to directory with chart packages (default ".yacr-release-packages")
--passphrase-file string Location of a file which contains the passphrase for the signing key. Use '-' in order to read from stdin
--sign Use a PGP private key to sign this packageGlobal Flags:
--config string Config file (default is $HOME/.yacr.yaml)
```### Create GitHub Releases from Helm Chart Packages
Scans a path for Helm chart packages and creates releases in the specified GitHub repo uploading the packages.
```console
$ yacr upload --help
Upload Helm chart packages to GitHub ReleasesUsage:
yacr upload [flags]Flags:
-c, --commit string Target commit for release
-b, --git-base-url string GitHub Base URL (only needed for private GitHub) (default "https://api.github.com/")
-r, --git-repo string GitHub repository
-u, --git-upload-url string GitHub Upload URL (only needed for private GitHub) (default "https://uploads.github.com/")
-h, --help help for upload
-o, --owner string GitHub username or organization
-p, --package-path string Path to directory with chart packages (default ".yacr-release-packages")
--release-name-template string Go template for computing release names, using chart metadata (default "{{ .Name }}-{{ .Version }}")
-t, --token string GitHub Auth TokenGlobal Flags:
--config string Config file (default is $HOME/.yacr.yaml)
```### Create the Repository Index from GitHub Releases
Once uploaded you can create an `index.yaml` file that can be hosted on GitHub Pages (or elsewhere).
```console
$ yacr index --help
Update a Helm chart repository index.yaml file based on a the
given GitHub repository's releases.Usage:
yacr index [flags]Flags:
-c, --charts-repo string The URL to the charts repository
-b, --git-base-url string GitHub Base URL (only needed for private GitHub) (default "https://api.github.com/")
-r, --git-repo string GitHub repository
-u, --git-upload-url string GitHub Upload URL (only needed for private GitHub) (default "https://uploads.github.com/")
-h, --help help for index
-i, --index-path string Path to index file (default ".yacr-index/index.yaml")
-o, --owner string GitHub username or organization
-p, --package-path string Path to directory with chart packages (default ".yacr-release-packages")
--release-name-template string Go template for computing release names, using chart metadata (default "{{ .Name }}-{{ .Version }}")
-t, --token string GitHub Auth Token (only needed for private repos)
--packages-with-index Save a copy of the package files to the GitHub pages branch and reference them in the indexGlobal Flags:
--config string Config file (default is $HOME/.yacr.yaml)
```## Configuration
`yacr` is a command-line application.
All command-line flags can also be set via environment variables or config file.
Environment variables must be prefixed with `YACR_`.
Underscores must be used instead of hyphens.CLI flags, environment variables, and a config file can be mixed.
The following order of precedence applies:1. CLI flags
1. Environment variables
1. Config file### Examples
The following example show various ways of configuring the same thing:
#### CLI
yacr upload --owner myaccount --git-repo helm-charts --package-path .deploy --token 123456789
#### Environment Variables
export YACR_OWNER=myaccount
export YACR_GIT_REPO=helm-charts
export YACR_PACKAGE_PATH=.deploy
export YACR_TOKEN="123456789"
export YACR_GIT_BASE_URL="https://api.github.com/"
export YACR_GIT_UPLOAD_URL="https://uploads.github.com/"yacr upload
#### Config File
`config.yaml`:
```yaml
owner: myaccount
git-repo: helm-charts
package-path: .deploy
token: 123456789
git-base-url: https://api.github.com/
git-upload-url: https://uploads.github.com/
```#### Config Usage
yacr upload --config config.yaml
`yacr` supports any format [Viper](https://github.com/spf13/viper) can read, i. e. JSON, TOML, YAML, HCL, and Java properties files.
Notice that if no config file is specified, `yacr.yaml` (or any of the supported formats) is loaded from the current directory, `$HOME/.yacr`, or `/etc/yacr`, in that order, if found.
#### Notes for Github Enterprise Users
For Github Enterprise, `yacr` users need to set `git-base-url` and `git-upload-url` correctly, but the correct values are not always obvious to endusers.
By default they are often along these lines:
```
https://ghe.example.com/api/v3/
https://ghe.example.com/api/uploads/
```If you are trying to figure out what your `upload_url` is try to use a curl command like this:
`curl -u username:token https://example.com/api/v3/repos/org/repo/releases`
and then look for `upload_url`. You need the part of the URL that appears before `repos/` in the path.## Goals
- [ ] [kubeval](https://github.com/instrumenta/kubeval) style schema validation
- [ ] [helm lint](https://helm.sh/docs/helm/helm_lint/)
- [ ] [Conftest](https://github.com/open-policy-agent/conftest/)
- [ ] Only package a chart if it has changed
- [ ] Add ability to update dependencies before packaging
- [ ] Add option to insert release notes similar to [buchanae/github-release-notes](https://github.com/buchanae/github-release-notes)- Copyright © [stecky](https://github.com/stecky)