Skip to content

Commit

Permalink
Added Helm-deploy job template (#84)
Browse files Browse the repository at this point in the history
- Updated docs with credentials info
  • Loading branch information
vshatravenko authored and Louis committed Nov 2, 2017
1 parent e98e636 commit 01ac334
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tpl/service/%output_path%/pipelines/review.yml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,13 @@ jobs:
trigger: true
- task: run-tests
file: <%= @name %>-repository/<%= @output %>/pipelines/tasks/run-tests.yml

- name: helm-deploy
serial: true
plan:
- get: <%= @name %>-repository
- task: helm-deploy
file: <%= @name %>-repository/<%= @output %>/pipelines/tasks/helm-deploy.yml
params:
GOOGLE_APPLICATION_JSON: ((gcr_password))
KUBECONFIG_FILE: ((kubeconfig))
22 changes: 22 additions & 0 deletions tpl/service/%output_path%/pipelines/tasks/helm-deploy.yml.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
platform: linux

image_resource:
type: docker-image
source:
repository: heliostech/kite

inputs:
- name: <%= @name %>-repository

run:
path: "sh"
args:
- "-exc"
- |
helm init --client-only
echo ${GOOGLE_APPLICATION_JSON} > gcr_credentials.json
export GOOGLE_APPLICATION_CREDENTIALS="${PWD}/gcr_credentials.json"
echo ${KUBECONFIG_FILE} | base64 -d > kubeconfig
export KUBECONFIG="${PWD}/kubeconfig"
helm install <%= @name %>-repository/.kite/charts/<%= @name %>
10 changes: 9 additions & 1 deletion tpl/service/docs/pipeline.md.tt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# About
__Pipeline__ described in `<%= output_path %>/pipelines/review.yml`

## Credentials overview

- git_private_key - RSA key with access to your repository
- github_token - [Github token](https://github.com/settings/tokens) with access to web hooks
- gcr_password - JSON containing your [GCP credentials](https://developers.google.com/identity/protocols/application-default-credentials)
- slack_webhook - address of your [Slack Incoming Webhook](https://api.slack.com/incoming-webhooks)
- kubeconfig - your Kubernetes config encoded in base64

## Configurations overview

A pipeline is configured with __three sections__:
Expand All @@ -29,7 +37,7 @@ In `jobs` described actions of pipeline, how resources progress through it, and
- `build-master`
- set `serial: true` to build and execute one-by-one, rather than executing in parallel
- set `trigger: true` to make a new build of the job when new version available on git.
- configure <%= @name %>-repository `uri` to change ssh link to your respository.
- configure <%= @name %>-repository `uri` to change ssh link to your respository.
- configure <%= @name %>-repository `branch` to change building branch of your respository.

# Getting stated
Expand Down

0 comments on commit 01ac334

Please sign in to comment.