Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3901)

Unified Diff: catapult_build/appengine_deploy.py

Issue 2701113002: Migrate to the Google Cloud SDK. (Closed)
Patch Set: Work for both old and new SDKs. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dashboard/bin/deploy » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: catapult_build/appengine_deploy.py
diff --git a/catapult_build/appengine_deploy.py b/catapult_build/appengine_deploy.py
index a7316a18c70041cf94074e197971c1f839debe6c..f2faa5b9d4165b2721b45cf587460195caf95841 100644
--- a/catapult_build/appengine_deploy.py
+++ b/catapult_build/appengine_deploy.py
@@ -13,31 +13,32 @@ import sys
from catapult_build import temp_deployment_dir
-def AppcfgUpdate(paths, app_id, service_name=None):
+def Deploy(paths, args):
"""Deploys a new version of an App Engine app from a temporary directory.
Args:
paths: List of paths to files and directories that should be linked
(or copied) in the deployment directory.
- app_id: The application ID to use.
+ args: Arguments passed to "gcloud app deploy".
"""
with temp_deployment_dir.TempDeploymentDir(
paths, use_symlinks=False) as temp_dir:
print 'Deploying from "%s".' % temp_dir
- script_path = _FindScriptInPath('appcfg.py')
+ # google-cloud-sdk/bin/gcloud is a shell script, which we can't subprocess
+ # on Windows with shell=False. So, execute the Python script directly.
+ if os.name == 'nt':
+ script_path = _FindScriptInPath('gcloud.cmd')
+ else:
+ script_path = _FindScriptInPath('gcloud')
if not script_path:
- print 'This script requires the App Engine SDK to be in PATH.'
+ print 'This script requires the Google Cloud SDK to be in PATH.'
+ print 'https://cloud.google.com/sdk/'
sys.exit(1)
- subprocess.call([
- sys.executable,
- script_path,
- '--application=%s' % app_id,
- '--version=%s' % _VersionName(),
- 'update',
- os.path.join(temp_dir, service_name) if service_name else temp_dir,
- ])
+ subprocess.call([script_path, 'app', 'deploy', '--no-promote',
+ '--version', _VersionName()] + args,
+ cwd=temp_dir)
def _FindScriptInPath(script_name):
« no previous file with comments | « no previous file | dashboard/bin/deploy » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698