Code Monkey home page Code Monkey logo

helm-github-pages's Introduction

Helm GitHub Pages CircleCI

You can publish your Kubernetes Helm charts on GitHub Pages.

Example

Here is my workflow to publish the chart:

> git commit
> git push origin master
  ↓ Push
+--------------+
| GitHub       | https://github.com/int128/kubernetes-dashboard-proxy
+--------------+
  ↓ Webhook
+--------------+
| CircleCI     |
+--------------+
  ↓ Push
+--------------+
| GitHub       | https://github.com/int128/helm-charts
+--------------+
  ↓ Publish
+--------------+
| GitHub Pages | https://int128.github.io/helm-charts
+--------------+

You can install the chart by the following:

helm repo add int128 https://int128.github.io/helm-charts
helm repo update
helm install int128/kubernetes-dashboard-proxy

Getting Started

1. Create a repository for publishing your charts

Create a new repository with README.md on GitHub. Then create gh-pages branch as follows:

git clone https://github.com/USERNAME/helm-charts
cd helm-charts
git checkout -b gh-pages
git push origin gh-pages

Make sure that gh-pages branch of the repository is published on GitHub Pages.

2. Create a chart

Create a new repository with README.md on GitHub. Then create a chart as follows:

git clone https://github.com/USERNAME/hello-world
cd hello-world

# Create a chart
mkdir charts
cd charts
helm create example

# Push the change
git add charts
git commit -m 'Add charts'
git push origin master

Now your repository looks like:

/README.md
/charts
/charts/example
/charts/example/.helmignore
/charts/example/Chart.yaml
/charts/example/templates
/charts/example/templates/NOTES.txt
/charts/example/templates/_helpers.tpl
/charts/example/templates/deployment.yaml
/charts/example/templates/ingress.yaml
/charts/example/templates/service.yaml
/charts/example/values.yaml

3. Fork this repository

Fork this repository. You can access to the script by https://raw.githubusercontent.com/USERNAME/helm-github-pages/master/publish.sh.

4. Setup CircleCI

Create .circleci/config.yml in the repository.

version: 2
jobs:
  build:
    docker:
      - image: alpine
    steps:
      - checkout
      - run:
          name: helm-github-pages
          environment:
            - GITHUB_PAGES_REPO: USERNAME/helm-charts
          command: wget -O - https://raw.githubusercontent.com/USERNAME/helm-github-pages/master/publish.sh | sh

Push the change.

git add .circleci/
git commit -m 'Add .circleci'
git push origin master

Then open CircleCI and add the repository.

You must configure a checkout key as follows:

  1. Open settings of your repository on CircleCI.
  2. Open the Checkout SSH keys in the Permissions section.
  3. Click the Create and add user key button.

Make sure that the build is successfully finished.

5. Test the chart

Add the Helm Charts repository.

helm repo add USERNAME https://USERNAME.github.io/helm-charts
helm repo update

Make sure that your chart is available.

# Show values for the chart
helm inspect USERNAME/example

# Install the chart
helm install USERNAME/example

Configuration

You can set the following environment variables:

Name Value Default
GITHUB_PAGES_REPO URL of the repository for publishing Mandatory
GITHUB_PAGES_BRANCH Branch name for publishing gh-pages
HELM_CHARTS_SOURCE Helm Charts source directory ./charts
HELM_VERSION Helm version 2.8.1

See also .circleci/config.yml in this repository.

Contribution

This is an open source software licensed under Apache License 2.0. Feel free to open issues or pull requests.

How it works

The script assumes that it is running on the Alpine image and CircleCI docker environment.

It does the following steps:

  1. Check out the gh-pages branch of the repository for publishing.
  2. helm lint for each chart.
  3. helm package for each chart.
  4. helm repo index for all charts.
  5. If the master branch is pushed, publish the charts.

helm-github-pages's People

Contributors

int128 avatar julienbreux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.