1
0
mirror of https://github.com/helm/chart-testing.git synced 2026-02-05 18:45:18 +01:00
Reinhard Nägele f632cd5081 Re-write it in Go (#35)
* Re-write it in Go

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix loading config from home dir

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Print config

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove git gc test code

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove year in copyright header

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add alias for lint-and-install

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix examples

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove OWNERS file

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add docs generation

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update CircleCI

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update readme

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Document building and releasing

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove Makefile

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Hide doc-gen command

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add support for Helm extra args

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update tool dependencies

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update Goreleaser

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Upgrade pip

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update Gopkg.lock

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add log messages

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix CircleCI env var for tag

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add Docker login

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Readme update for MacOS (#1)

* Add build.sh mac prerequisites, and README markdown linting fixes

Signed-off-by: Scott Rigby <scott@r6by.com>

* Update README.md

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update Gopkg.lock

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update config search locations

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add config files to distro

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add debug flag

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add note on config files for linting

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix link

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Revert "Update Gopkg.lock"

This reverts commit fcbfbdc9db.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix link

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix readme

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00
2018-04-24 11:32:38 +02:00
2018-11-07 13:06:20 -05:00
2018-11-07 13:06:20 -05:00

Chart Testing

ct is the the tool for testing Helm charts. It is meant to be used for linting and testing pull requests. It automatically detects charts changed against the target branch.

Installation

Prerequisites

It is recommended to use the provided Docker image which can be found on Quay. It comes with all necessary tools installed.

Binary Distribution

Download the release distribution for your OS from the Releases page:

https://github.com/helm/chart-testing/releases

Unpack the ct binary, add it to your PATH, and you are good to go!

Docker Image

A Docker image is available at quay.io/helmpack/chart-testing.

Usage

See documentation for individual commands:

Configuration

ct 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 CT_. 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
  2. Environment variables
  3. Config file

Note that linting requires config file for yamllint and yamale. If not specified, these files are search in the current directory, $HOME/.ct, and /etc/ct, in that order. Samples are provided in the etc folder.

Examples

The following example show various way of configuring the same thing:

CLI

ct install --remote upstream --chart-dirs stable,incubator --build-id pr-42

Environment Variables

export CT_REMOTE=upstream
export CT_CHART_DIRS=stable,incubator
export CT_BUILD_ID

ct install

Config File

config.yaml:

remote: upstream
chart-dirs:
  - stable
  - incubator
build-id: pr-42

ct install --config config.yaml

ct supports any format Viper can read, i. e. JSON, TOML, YAML, HCL, and Java properties files.

Building from Source

ct is built using Go 1.11. Older versions may work but have not been tested.

build.sh is used to build and release the tool. It uses Goreleaser under the covers.

Note: on MacOS you will need GNU Coreutils readlink. You can install it with:

brew install coreutils

Then add gnubin to your $PATH, with:

echo 'export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"' >> ~/.bash_profile
bash --login

To use the build script:

$ ./build.sh -h
Usage: build.sh <options>

Build ct using Goreleaser.

    -h, --help      Display help
    -d, --debug     Display verbose output and run Goreleaser with --debug
    -r, --release   Create a release using Goreleaser. This includes the creation
                    of a GitHub release and building and pushing the Docker image.
                    If this flag is not specified, Goreleaser is run with --snapshot

Releasing

CircleCI creates releases automatically when a new tag is pushed. Tags are created using tag.sh.

$ ./tag.sh -h
Usage: tag.sh <options>

Create and push a tag.

    -h, --help        Display help
    -d, --debug       Display verbose output
    -r, --remote      The name of the remote to push the tag to (default: upstream)
    -f, --force       Force an existing tag to be overwritten
    -t, --tag         The name of the tag to create
    -s, --skip-push   Skip pushing the tag
Description
CLI tool for linting and testing Helm charts
Readme Apache-2.0 9.6 MiB
Languages
Go 92.1%
Smarty 4%
Shell 2.6%
Dockerfile 1.3%