From 7da298b88d5bc2440e39abc543278255ae86eb6f Mon Sep 17 00:00:00 2001 From: Naseem Date: Thu, 12 Sep 2019 06:55:44 -0400 Subject: [PATCH] Add documentation for use with Google Cloud Build (#170) Signed-off-by: Naseem --- examples/gcp-cloud-build/README.md | 5 ++++ examples/gcp-cloud-build/cloudbuild.yaml | 30 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 examples/gcp-cloud-build/README.md create mode 100644 examples/gcp-cloud-build/cloudbuild.yaml diff --git a/examples/gcp-cloud-build/README.md b/examples/gcp-cloud-build/README.md new file mode 100644 index 00000000..392a141f --- /dev/null +++ b/examples/gcp-cloud-build/README.md @@ -0,0 +1,5 @@ +# Chart testing example with Google Cloud Build + +This example shows how to lint and test charts using [Google Cloud Build](https://cloud.google.com/cloud-build/) + +Since Google Cloud Build will ignore copying over `.git` by default, you will need to initialize `git` and add a `remote`. This example assumes that there is a pre-existing GKE cluster with `helm` already installed. diff --git a/examples/gcp-cloud-build/cloudbuild.yaml b/examples/gcp-cloud-build/cloudbuild.yaml new file mode 100644 index 00000000..c6ebc0c9 --- /dev/null +++ b/examples/gcp-cloud-build/cloudbuild.yaml @@ -0,0 +1,30 @@ +steps: + +- name: 'gcr.io/cloud-builders/git' + id: 'git-init' + args: ['init'] + waitFor: ['-'] + +- name: 'gcr.io/cloud-builders/git' + id: 'git-add-remote' + args: ['remote', 'add', 'origin', 'git@github.com:github-account/charts-repo.git'] + waitFor: ['git-init'] + +- name: 'gcr.io/cloud-builders/kubectl' + id: 'cluster-info' + args: ['cluster-info'] + waitFor: ['git-add-remote'] + +- name: quay.io/helmpack/chart-testing + id: 'lint-and-install-charts' + entrypoint: 'ct' + args: ['lint-and-install'] + waitFor: ['cluster-info'] + +options: + env: + - CLOUDSDK_COMPUTE_ZONE=cluster-location + - CLOUDSDK_CONTAINER_CLUSTER=cluster-name + +timeout: + 3600s