Skip to content

Instantly share code, notes, and snippets.

@felds
Last active April 28, 2021 04:54
Show Gist options
  • Save felds/51c08463c7ae7084f343bd8933983f60 to your computer and use it in GitHub Desktop.
Save felds/51c08463c7ae7084f343bd8933983f60 to your computer and use it in GitHub Desktop.
Cloud Build to GCE sample
# IMPORTANT:
# Dont forget to to replace the INSTANCE_NAME for the name
# of the instance we created on step 2
steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- '-t'
- 'gcr.io/$PROJECT_ID/docker-node-hello-world:$COMMIT_SHA'
- .
- name: gcr.io/cloud-builders/gcloud
args:
- compute
- instances
- update-container
- INSTANCE_NAME
- '--zone=us-central1-a'
- '--container-image=gcr.io/$PROJECT_ID/docker-node-hello-world:$COMMIT_SHA'
images:
- 'gcr.io/$PROJECT_ID/docker-node-hello-world:$COMMIT_SHA'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment