EastsidePreparatorySchool / epschedule

A schedule app for Eastside Preparatory School
https://www.epschedule.com
MIT License
16 stars 14 forks source link

Display version number of app in drawer #215

Open juberti opened 9 years ago

juberti commented 9 years ago

Possibly a 1.1.0, or maybe the build date, e.g. 20150925

juberti commented 1 year ago

Code snippet to get the deploy date from App Engine. Credentials can probably be obtained directly from our env var rather than using ServiceAccountCredentials.

from googleapiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials

credentials = ServiceAccountCredentials.from_json_keyfile_name(
    'path/to/service-account-key.json', 
    ['https://www.googleapis.com/auth/cloud-platform'])

appengine = build('appengine', 'v1', credentials=credentials)

project_id = 'your-project-id'
version_id = 'your-version-id'

version = appengine.apps().services().versions().get(
    appsId=project_id, 
    servicesId='default', 
    versionsId=version_id).execute()

create_time = version.get('createTime')
print('Deployment time:', create_time)