Search code examples
google-cloud-platformgcloudappcfg

What's the gcloud equivalent of appcfg rollback?


The GCP command appcfg has been deprecated. appcfg used to have appcfg rollback to be used when there is a failed deployment.

What is its equivalent for gcloud (the new command)? I can't find it in Google GCP documentation.

More context:

Rolling back in appcfg was not meant for managing the traffic and going back to the previous version. It was used to remove the lock on your deploy.

If you had an unsuccessful deployment, you were not able to deploy any more. appcfg rollback was used to remove that lock and make it available for you to deploy again.


Solution

  • I think there is no direct command to appcfg rollback. However, I would highly recommend you to consider the Splitting the traffic option.

    This will let you redirect the traffic from one of your versions to another, even between old versions of your service.

    Let's imagine this:

    • You have version 1 of your service and it works just fine.
    • A couple weeks later you decide to deploy a new the version: version 2
    • However, the deploy fails and your app is completely down. You are loosing users and money. Everything is on fire.
    • You can easily switch the traffic to the trusty version 1 by redirecting 100% of the traffic to it.
    • Version 2 is out of the game until you deploy a new version.

    The advantage of this is that you don't have to wait until the rollback is done. The traffic is automatically redirected to an old version. Additionally, it has the gcloud set traffic command for you to run it via the CLI.

    Hope this is helpful!