Beispiel #1
0
def _prod_deployment_helper(config_dir,
                            package_zip_paths,
                            deploy_go=True,
                            deploy_appengine=True):
  """Helper for production deployment."""
  config = local_config.Config()
  deployment_bucket = config.get('project.deployment.bucket')

  gae_config = config.sub_config(local_config.GAE_CONFIG_PATH)
  gae_deployment = gae_config.sub_config('deployment')
  project = gae_config.get('application_id')

  print('Deploying %s to prod.' % project)
  yaml_paths = gae_deployment.get_absolute_path('prod')
  yaml_paths = appengine.filter_yaml_paths(yaml_paths, deploy_go)

  if deploy_appengine:
    _update_pubsub_queues(project)
    _update_alerts(project)
    _update_bigquery(project)

  _deploy_app_prod(
      project,
      deployment_bucket,
      yaml_paths,
      package_zip_paths,
      deploy_appengine=deploy_appengine)

  if deploy_appengine:
    common.execute('python butler.py run setup --config-dir {config_dir} '
                   '--non-dry-run'.format(config_dir=config_dir))
  print('Production deployment finished.')
Beispiel #2
0
def _staging_deployment_helper(deploy_go):
  """Helper for staging deployment."""
  config = local_config.Config(local_config.GAE_CONFIG_PATH)
  project = config.get('application_id')

  print('Deploying %s to staging.' % project)
  deployment_config = config.sub_config('deployment')
  yaml_paths = deployment_config.get_absolute_path('staging')
  yaml_paths = appengine.filter_yaml_paths(yaml_paths, deploy_go)

  _deploy_app_staging(project, yaml_paths)
  print('Staging deployment finished.')