App Engine Dev Tips #4 : Learn To Use rollback

Imagine a scenario like this:

  1. You have tested your application locally. All looks good.
  2. You click on Deploy To App Engine and begin the process of uploading the application.

Suddenly, the network connection plays spoilsport and your update does not completely successfully. Every subsequent effort to deploy your application results in an error thrown back to you, where App Engine reminds you that the last update did not go through properly and that you should use a rollback.

But what is rollback and how does one do that?

App Engine SDK provides a script appcfg.cmd that can be used to control a lot of App Engine commands from the command line. In particular, it also has a rollback command that allows you to tell App Engine to rollback to go back to the last good version of your application. It is required to get back to this state so that you can do subsequent updates of your App Engine application.

The appcfg.cmd script file is found inside the /bin folder of your App Engine SDK Installation Directory.

The command to execute the rollback is :

appcfg.cmd  rollback <war-location>

where <war-location> points to the war folder of App Engine project.

For e.g. if your App Engine project is in c:\myprojects\helloworld directory, then the rollback command is :

appcfg.cmd rollback c:\myprojects\helloworld\war

Make sure that the network connection is good when issuing the command. Wait a few moments and App Engine will rollback to the last good version. After that continue with your normal Deployment process.

Check out all the App Engine Development Tips.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s