How do I find out the timestamp when a Python application was deployed to GAE?

I need to know the timestamp when my application was deployed to the GAE server. At run time.

Of course, I could create some Python constant in the deployment script. But is there an easier and more correct way to achieve the goal?

(I wouldn't want to use a data store for this.)


source to share

2 answers


in a shell script. update

Save the current time before launching , possibly adjusting for your time zone, if necessary, in a file marked as a resource. You can open and read this file from the deployed application.

Alternatively, let the script replace the current time directly in the code, eliminating the need to open the file.



I don't believe there is a GAE API that gives you access to a deployment timestamp.

The closest functionality is the CURRENT_VERSION_ID

environment variable, but this gives you access to version

that specified in app.yaml

, not timestamps.



All Articles