Skip to main content

ChartPress: render and publish helm charts and images

Project description

chartpress

Automate building and publishing helm charts and associated images.

This is used as part of the JupyterHub and Binder projects.

Chartpress will:

  • build docker images and tag them with the latest git commit
  • publish those images to DockerHub
  • rerender a chart to include the tagged images
  • publish the chart and index to gh-pages

A chartpress.yaml file contains a specification of charts and images to build.

For example:

charts:
  # list of charts by name
  # each name should be a directory containing a helm chart
  - name: binderhub
    # the prefix to use for built images
    imagePrefix: jupyterhub/k8s-
    # the git repo whose gh-pages contains the charts
    repo:
      git: jupyterhub/helm-chart
      published: https://jupyterhub.github.io/helm-chart
    # additional paths (if any) relevant to the chart version
    # outside the chart directory itself
    paths:
      - ../setup.py
      - ../binderhub
    # images to build for this chart (optional)
    images:
      binderhub:
        # Context to send to docker build for use by the Dockerfile
        # (if different from the current directory)
        contextPath: ..
        # Dockerfile path, if different from the default
        # (may be needed if contextPath is set)
        dockerfilePath: images/binderhub/Dockerfile
        # path in values.yaml to be updated with image name and tag
        valuesPath: image
        # additional paths (if any) relevant to the image
        # outside the image directory itself
        paths:
          - ../setup.py
          - ../binderhub

Usage

In a directory containing a chartpress.yaml, run:

chartpress

to build your chart(s) and image(s). Add --push to publish images to docker hub and --publish-chart to publish the chart and index to gh-pages.

usage: chartpress [-h] [--commit-range COMMIT_RANGE] [--push]
                  [--publish-chart] [--tag TAG]
                  [--extra-message EXTRA_MESSAGE]

Automate building and publishing helm charts and associated images. This is
used as part of the JupyterHub and Binder projects.

optional arguments:
  -h, --help            show this help message and exit
  --commit-range COMMIT_RANGE
                        Range of commits to consider when building images
  --push                push built images to docker hub
  --publish-chart       publish updated chart to gh-pages
  --tag TAG             Use this tag for images & charts
  --extra-message EXTRA_MESSAGE
                        extra message to add to the commit message when
                        publishing charts

Caveats

Shallow clones

Chartpress detects the latest commit which changed a directory or file when determining the tag to use for charts and images. This means that shallow clones should not be used because if the last commit that changed a relevant file is outside the shallow commit range, the wrong tag will be assigned.

Travis uses a clone depth of 50 by default, which can result in incorrect image tagging. You can disable this shallow clone behavior in your .travis.yml:

git:
  depth: false

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chartpress-0.3.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

chartpress-0.3.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file chartpress-0.3.0.tar.gz.

File metadata

  • Download URL: chartpress-0.3.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.2

File hashes

Hashes for chartpress-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a9a4068b61ee5aa4aba5cd502ff32182b2d0e6c8262030d0b68f2fa532116144
MD5 d2eb0ca0cdaf213bf862819cb989b421
BLAKE2b-256 da3bd7f2297a1d6c5606f3b5da7a4f602c564604a52cab84df2137a68b30cee3

See more details on using hashes here.

Provenance

File details

Details for the file chartpress-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: chartpress-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.2

File hashes

Hashes for chartpress-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a79cb434af8d50a8c021f891055ca21f071f237051a97c16897b1971d4fc5a0
MD5 54c75929f7b714b91605c97fd9ec3b7c
BLAKE2b-256 d2176d92a67a38ba4cf106eb7ed8ba8b66c5a1738022639d9dcbb5616b3804de

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page