Pavel Vlasov
Pavel Vlasov

Reputation: 4331

How do I know timestamp when my Python app was deployed on GAE?

I need to know a value holding timestamp when my app was deployed on the GAE server. In runtime.

Surely I could generate some Python constant in the deployment script. But is there an easier and more correct way to reach the goal?

(I'd like not to use data store for that.)

Upvotes: 3

Views: 288

Answers (2)

Dave W. Smith
Dave W. Smith

Reputation: 24956

Wrap appcfg.py in a shell script. Before actually running appcfg.py update, save the current time, possibly adjusting for your time zone, if necessary, in a file that's marked as a resource. You can open and read that file from the deployed app.

Alternatively, have that script substitute the current time directly into code, obviating the need for a file open.

Upvotes: 4

Amber
Amber

Reputation: 526513

I do not believe there is a GAE API that gives you access to the deploy timestamp.

The closest functionality is the CURRENT_VERSION_ID environment variable, but that only gives you access to the version specified in app.yaml, not timestamps.

Upvotes: 2

Related Questions