Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def write_configs(self):
""" Generates the configurations need for pipes """
utils.banner("Generating Configs")
if not self.gitlab_token_path:
raise SystemExit('Must provide private token file as well.')
self.configs = configs.process_git_configs(
git_short=self.git_short,
token_file=self.gitlab_token_path)
configs.write_variables(app_configs=self.configs,
out_file=self.raw_path,
git_short=self.git_short)
def slack_notify(self):
""" Sends out a slack notification """
utils.banner("Sending slack notification")
if self.env.startswith("prod"):
notify = slacknotify.SlackNotification(app=self.app,
env=self.env,
prop_path=self.json_path)
notify.post_message()
else:
LOG.info("No slack message sent, not production environment")
def create_elb(self):
""" Creates the ELB for the defined environment """
utils.banner("Creating ELB")
elbobj = elb.SpinnakerELB(app=self.app,
env=self.env,
region=self.region,
prop_path=self.json_path)
elbobj.create_elb()
def create_iam(self):
"""Create IAM resources."""
utils.banner("Creating IAM")
iam.create_iam_resources(env=self.env, app=self.app)
def create_pipeline(self, onetime=None):
""" Creates the spinnaker pipeline """
utils.banner("Creating Pipeline")
if not onetime:
spinnakerpipeline = pipeline.SpinnakerPipeline(
app=self.app,
trigger_job=self.trigger_job,
prop_path=self.json_path,
base=None,
token_file=self.gitlab_token_path)
else:
spinnakerpipeline = pipeline.SpinnakerPipelineOnetime(
app=self.app,
trigger_job=self.trigger_job,
prop_path=self.json_path,
base=None,
token_file=self.gitlab_token_path,
onetime=onetime)
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)
def create_elb(self):
"""Create the ELB for the defined environment."""
utils.banner("Creating ELB")
elbobj = elb.SpinnakerELB(app=self.app, env=self.env, region=self.region, prop_path=self.json_path)
elbobj.create_elb()
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()