diff --git a/examples/gcp-cloud-build/README.md b/examples/gcp-cloud-build/README.md new file mode 100644 index 0000000..392a141 --- /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 0000000..c6ebc0c --- /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