diff --git a/scripts/deploy.py b/scripts/deploy.py index 87614be55591..e4685a4461ee 100644 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -106,6 +106,8 @@ def preprocess_release(): (1) Substitutes files from the per-app deployment data. (2) Change the DEV_MODE constant in assets/constants.js. + (3) Removes the "version" field from app.yaml, since gcloud does not like + it (when deploying). """ if not os.path.exists(DEPLOY_DATA_PATH): raise Exception( @@ -150,6 +152,17 @@ def preprocess_release(): with open(os.path.join('assets', 'constants.js'), 'w+') as new_assets_file: new_assets_file.write(content) + # Removes the version field from app.yaml. + print 'Removing the version field from app.yaml ...' + with open('app.yaml', 'r') as f: + content = f.read() + assert content.count('version: default') == 1 + os.remove('app.yaml') + content = content.replace('version: default', '') + with open('app.yaml', 'w') as f: + f.write(content) + print 'Version field removed.' + def _execute_deployment(): """Executes the deployment process after doing the prerequisite checks."""