Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppEngine: Get current serving application version

Is there a simple way to get the current serving application version in AppEngine?

like image 768
Koen Bok Avatar asked Oct 16 '10 12:10

Koen Bok


People also ask

What type of service model is Google Appengine using?

Google App Engine (GAE) is a platform-as-a-service product that provides web app developers and enterprises with access to Google's scalable hosting and tier 1 internet service.

How do I uninstall App Engine versions?

You can find the list of your app versions in the Versions page. To delete the non-default versions, select the check boxes and then click Delete.


2 Answers

os.environ['CURRENT_VERSION_ID']

like image 183
Drew Sears Avatar answered Sep 22 '22 21:09

Drew Sears


String version = SystemProperty.version.get(); String applicationVersion = SystemProperty.applicationVersion.get(); 

This is the syntax:

public static final SystemProperty applicationVersion 

The major version number for the currently running version of the application plus a timestamp at which it was deployed. Has the key, "com.google.appengine.application.version".

See here

PS. One puzzle still remains. What does timestamp next to version means and how to read it??

EDIT: Here is the key to the mystery.

 Date UploadDate = new Date(Long.parseLong(    applicationVersion.substring(applicationVersion.lastIndexOf(‌​".")+1))    / (2 << 27) * 1000); 
like image 43
husayt Avatar answered Sep 23 '22 21:09

husayt