Skip to content

Commit

Permalink
Fixed BitBucket deployment source.
Browse files Browse the repository at this point in the history
  • Loading branch information
gitwater committed Jul 16, 2021
1 parent 6239f97 commit f718989
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/paco/application/reseng_deploymentpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ def init_resource(self):
self.artifacts_bucket_policy_resource_arns.append(
"paco.sub '${%s}'" % (self.pipeline.paco_ref + '.codepipeline_role.arn')
)

cpbd_s3_bucket_policy = {
'aws': self.artifacts_bucket_policy_resource_arns,
'action': [ 's3:*' ],
Expand All @@ -684,10 +685,14 @@ def init_stage_action_github_source(self, action_config):
return

def init_stage_action_bitbucket_source(self, action_config):
"Initialize a GitHub.Source action"
"Initialize a BitBucket.Source action"
if not action_config.is_enabled():
return

self.artifacts_bucket_policy_resource_arns.append(
"paco.sub '${%s.%s.arn}'" % (action_config.paco_ref, "codestar.connection"))


def init_stage_action_codecommit_source(self, action_config):
"Initialize an IAM Role for the CodeCommit action"
if not action_config.is_enabled():
Expand Down Expand Up @@ -1272,18 +1277,23 @@ def resolve_ref(self, ref):
return ref.resource._stack

elif schemas.IDeploymentPipelineSourceCodeCommit.providedBy(ref.resource):
# CodeCommit
# CodeCommit Source
if ref.resource_ref == self.codecommit_role_name+'.arn':
iam_ctl = self.paco_ctx.get_controller("IAM")
return iam_ctl.role_arn(ref.raw[:-4])
elif ref.resource_ref == 'codecommit.arn':
codecommit_ref = ref.resource.codecommit_repository
return self.paco_ctx.get_ref(codecommit_ref+".arn")
elif schemas.IDeploymentPipelineSourceGitHub.providedBy(ref.resource):
# GitHub
# GitHub SOurce
if ref.resource_ref == self.github_role_name + '.arn':
iam_ctl = self.paco_ctx.get_controller("IAM")
return iam_ctl.role_arn(ref.raw[:-4])
elif schemas.IDeploymentPipelineSourceBitBucket.providedBy(ref.resource):
# BitBucket Source
if ref.resource_ref == 'codestar.connection.arn':
return ref.resource._stack.template.get_bitbucket_codestar_connection_role_arn()

elif schemas.IDeploymentPipelineBuildCodeBuild.providedBy(ref.resource):
# CodeBuild
if ref.resource_ref == 'project_role.arn':
Expand Down

0 comments on commit f718989

Please sign in to comment.