Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def s3deployment(mock_get_details, mock_get_props):
"""Creates S3Deployment Fixture"""
mock_get_props.return_value = {"deploy_strategy": "highlander",
"s3": {"path": "/"}}
mock_get_details.return_value.s3_app_bucket.return_value = "testapp"
deployobj = s3.S3Deployment(app="testapp",
env="dev",
region="us-east-1",
prop_path="/",
artifact_path="/artifact",
artifact_version="1")
return deployobj
def deploy_s3app(self):
"""Deploys artifacts contents to S3 bucket"""
utils.banner("Deploying S3 App")
primary_region = self.configs['pipeline']['primary_region']
s3obj = s3.S3Deployment(
app=self.app,
env=self.env,
region=self.region,
prop_path=self.json_path,
artifact_path=self.artifact_path,
artifact_version=self.artifact_version,
primary_region=primary_region)
s3obj.upload_artifacts()
def promote_s3app(self):
"""promotes S3 deployment to LATEST"""
utils.banner("Promoting S3 App")
primary_region = self.configs['pipeline']['primary_region']
s3obj = s3.S3Deployment(
app=self.app,
env=self.env,
region=self.region,
prop_path=self.json_path,
artifact_path=self.artifact_path,
artifact_version=self.artifact_version,
primary_region=primary_region)
s3obj.promote_artifacts(promote_stage=self.promote_stage)