Skip to content

Commit

Permalink
Add removal of app.yaml version field to deploy script. (oppia#6564)
Browse files Browse the repository at this point in the history
* Add removal of version field to deploy script.

* Address review comment.
  • Loading branch information
seanlip authored Apr 17, 2019
1 parent 19547fd commit 0f931d4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit 0f931d4

Please sign in to comment.