def AppcfgUpdate(paths, app_id, service_name=None): """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. """ try: import appcfg # pylint: disable=unused-variable except ImportError: # TODO(qyearsley): Put the App Engine SDK in the path with the # binary dependency manager. # See: https://github.com/catapult-project/catapult/issues/2135 print 'This script requires the App Engine SDK to be in PYTHONPATH.' sys.exit(1) with temp_deployment_dir.TempDeploymentDir( paths, use_symlinks=False) as temp_dir: print 'Deploying from "%s".' % temp_dir _Run([ module_finder.FindModule('appcfg'), '--application=%s' % app_id, '--version=%s' % _VersionName(), 'update', os.path.join(temp_dir, service_name) if service_name else temp_dir, ])
def DevAppserver(paths, args): """Starts a dev server for an App Engine app. Args: paths: List of paths to files and directories that should be linked (or copied) in the deployment directory. args: List of additional arguments to pass to the dev server. """ try: import dev_appserver # pylint: disable=unused-variable except ImportError: # TODO(qyearsley): Put the App Engine SDK in the path with the # binary dependency manager. print 'This script requires the App Engine SDK to be in PYTHONPATH.' sys.exit(1) with temp_deployment_dir.TempDeploymentDir(paths) as temp_dir: print 'Running dev server on "%s".' % temp_dir subprocess.call([module_finder.FindModule('dev_appserver')] + args + [temp_dir])
def AppcfgUpdate(paths, app_id): """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. """ try: import appcfg # pylint: disable=unused-variable except ImportError: # TODO(qyearsley): Put the App Engine SDK in the path with the # binary dependency manager. print 'This script requires the App Engine SDK to be in PYTHONPATH.' sys.exit(1) with temp_deployment_dir.TempDeploymentDir(paths) as temp_dir: print 'Deploying from "%s".' % temp_dir _Run([ module_finder.FindModule('appcfg'), '--application=%s' % app_id, '--version=%s' % _VersionName(), 'update', temp_dir, ])