Skip to content

Instantly share code, notes, and snippets.

@mlabouardy
Created June 16, 2019 08:51
Show Gist options
  • Save mlabouardy/56bbd8aa43411219171e6ecf5883054c to your computer and use it in GitHub Desktop.
Save mlabouardy/56bbd8aa43411219171e6ecf5883054c to your computer and use it in GitHub Desktop.
Continuous deployment with Google Cloud Build on GCP
- id: 'configure kubectl'
name: 'gcr.io/cloud-builders/gcloud'
env:
- 'CLOUDSDK_COMPUTE_ZONE=${_CLOUDSDK_COMPUTE_ZONE}'
- 'CLOUDSDK_CONTAINER_CLUSTER=${_CLOUDSDK_CONTAINER_CLUSTER}'
- 'KUBECONFIG=/kube/config'
entrypoint: 'sh'
args:
- '-c'
- |
gcloud container clusters get-credentials "$${CLOUDSDK_CONTAINER_CLUSTER}" --zone "$${CLOUDSDK_COMPUTE_ZONE}"
volumes:
- name: 'kube'
path: /kube
- id: 'deploy to k8s'
name: 'gcr.io/cloud-builders/gcloud'
env:
- 'KUBECONFIG=/kube/config'
entrypoint: 'sh'
args:
- '-c'
- |
kubectl set image deployment/app app=registry.serverlessmovies.com/mlabouardy/app:$SHORT_SHA
volumes:
- name: 'kube'
path: /kube
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment