Skip to content

Commit

Permalink
Merge c7c218d into 11c9ff3
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Berg committed Jun 26, 2020
2 parents 11c9ff3 + c7c218d commit 52d9572
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
13 changes: 13 additions & 0 deletions chalicelib/check_setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,19 @@
}
}
},
"deploy_cgap_production": {
"title": "Deploy CGAP-portal master to the cgap production environment",
"group": "Deployment Checks",
"schedule": {
"deployment_checks": {
"data": {
"kwargs": {
"primary": true
}
}
}
}
},
"deploy_ff_staging": {
"title": "Deploy Fourfront master to staging.4dnucleome.org",
"group": "Deployment Checks",
Expand Down
44 changes: 35 additions & 9 deletions chalicelib/checks/deployment_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
FF_ENV_INDEXER, CGAP_ENV_INDEXER, is_fourfront_env, is_cgap_env,

)
from dcicutils.beanstalk_utils import compute_ff_prd_env
from dcicutils.beanstalk_utils import compute_cgap_prd_env, compute_ff_prd_env
from dcicutils.beanstalk_utils import beanstalk_info, is_indexing_finished


Expand Down Expand Up @@ -216,21 +216,47 @@ def deploy_application_to_beanstalk(connection, **kwargs):
return _deploy_application_to_beanstalk(connection, **kwargs)


@check_function()
def deploy_ff_staging(connection, **kwargs):
""" Deploys Fourfront master to whoever staging is.
Runs as part of the 'deployment_checks' schedule on data ONLY.
def deploy_env(connection, env_to_deploy, application_name, check, **kwargs):
""" For a given beanstalk environment, with a configured check json and given application name,
deploys the environment, or returns an error.
"""
this_check = CheckResult(connection, 'deploy_ff_staging')
env_to_deploy = compute_ff_stg_env()
this_check = CheckResult(connection, check)
helper_check = _deploy_application_to_beanstalk(connection,
env=env_to_deploy,
branch='master')
branch='master',
**kwargs)
if helper_check.status == 'PASS':
this_check.status = 'PASS'
this_check.summary = 'Successfully deployed Fourfront master to %s' % env_to_deploy
this_check.summary = ('Successfully deployed {what} master to {where}'
.format(what=application_name, where=env_to_deploy))
else:
this_check.status = 'ERROR'
this_check.summary = 'Error occurred during deployment, see full_output'
this_check.full_output = helper_check.summary # should have error message
return this_check


@check_function()
def deploy_ff_staging(connection, **kwargs):
""" Deploys Fourfront master to whoever staging is.
Runs as part of the 'deployment_checks' schedule on data ONLY.
"""
return deploy_env(
connection,
env_to_deploy=compute_ff_stg_env(),
application_name="Fourfront",
check='deploy_ff_staging',
**kwargs)


@check_function()
def deploy_cgap_production(connection, **kwargs):
""" Deploys CGAP portal master to production environment.
Eventually, this ought to be deprecated in favor of a staging deploy.
"""
return deploy_env(
connection,
env_to_deploy=compute_cgap_prd_env(),
application_name="CGAP Portal",
check='deploy_cgap_production',
**kwargs)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "foursight"
version = "0.11.7"
version = "0.11.8"
description = "Serverless Chalice Application for Monitoring"
authors = ["4DN-DCIC Team <support@4dnucleome.org>"]
license = "MIT"
Expand Down

0 comments on commit 52d9572

Please sign in to comment.