Reputation: 684
I'm using cloud build to automatically deploy new version of app when a specific github branch is updated.
Everything works great but I'd like to deploy the new version without starting it, keeping my previous version running. I really prefer to schedule start of the new version in specific hours, but when cloud build finish the process, my new version is automatically running.
How can I change this behaviour?
Upvotes: 0
Views: 257
Reputation: 2612
To avoid that the new version is started you can deploy using the --no-promote
flag.
To use this flag when deploying using gcloud just need to add it to the command and deploy like this:
gcloud app deploy --no-promote
To implement this as part of the CD with Cloud Build then you can edit the cloudbuild.yaml to add the flag like this:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '--no-promote']
timeout: '1600s'
Upvotes: 2