I am running a Virtual Machine on Google Cloud and am using their SDK to deploy with the following command:
gcloud preview app deploy ./app.yaml
The deployment works, however for every deployment a new instance is created which can only be reached by adding the version id to the domain name. I tried removing older instances through the developer dashboard but they just restart directly after that.
How can I remove the newly created instances and overwrite the default version on the main domain by default when deploying?
To do this directly from
gcloud
, use the following two flags:--set-default
:--version
:(both from
gcloud preview app deploy --help
).If you set
--version
to be the same each time, the current version deployed at that URL will be overwritten, and a new version will not be created on each deployment.If you use
--set-default
, the deployed version can be accessed just using the domain name (without the version as a subdomain).Deleting the other versions by hand in the developer console will be the simplest way to get rid of them.