Create changelogs for Helm Charts, based on git history.
The application depends on the assumption that the helm chart is released on the first commit where the version number is bumped in the Chart.yaml
file.
All sub-sequent commits are grouped as commits for the next release, until the version number is bumped again.
The changelog contains the following things:
- Commits are grouped by releases
- Each release displays
- Supported Helm version
- Release date
- App Version for the chart
- Supported Kubernetes version
- Changes in default helm values
This repository contains a set of example changelogs created for the github.com/prometheus-community/helm-charts charts.
All relevant commands are added to the Makefile
$ make help
Usage:
make <target>
Targets:
help Display this help
test-unit Run unit-tests
test-integration Run integration-tests
build Build binary
verify tests and builds
image build docker image
clean clean up created files
all Runs test, build and docker
test-coverage Generate test coverage report
lint Generate static analysis report
update-docs Upgrade automatic documentations
First build the standalone binary:
$ make build
go build -o ./bin/helm-changelog .
This results in a binary in ./bin/helm-changelog
.
# See all cli options
$ ./bin/helm-changelog --help
Create changelogs for Helm Charts, based on git history
Usage:
helm-changelog [flags]
Flags:
-h, --help help for helm-changelog
-v, --verbosity string Log level (debug, info, warn, error, fatal, panic (default "warning")
# Run helm-changelog creator with default params
$ ./bin/helm-changelog
The helm-changelog can alternatively be run in docker.
This is done in a multi-stage build, and does not require a working go development environment.
# Building the application and docker image
$ make image
# Run the resulting docker image
$ docker run -it --rm -v $(pwd):/data mogensen/helm-changelog:latest
The helm-changelog app is running as a non-root user.
This is a security best-practice. If user 1000
does not have write access to the chart directory, you may need to run the container as an other user.
# Run docker image as current user
$ docker run --user $UID it --rm -v $(pwd):/data mogensen/helm-changelog:latest
Unit tests are implemented with Go's standard test framework.
All tests are located in their own test-packages, enforcing that the tests only test the public interface of the go packages.
# Run unit tests and code coverage, including test for race conditions
$ make test-coverage