AWSCDKPipeline没有在将代码推送到Bitbucket时触发
创始人
2024-09-24 02:30:46
0
  1. 确保您的AWS CDK Pipeline已与Bitbucket集成,并且已经设置了正确的触发器。
  2. 您需要检查您的Bitbucket仓库是否配置了正确的Webhook,以触发管道。 以下是一个示例Bitbucket仓库配置的Python代码:
from aws_cdk import (
    core, 
    aws_codepipeline as codepipeline, 
    aws_codepipeline_actions as actions, 
    aws_codecommit as codecommit
)

class MyStack(core.Stack):

  def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
    super().__init__(scope, id, **kwargs)

    # Your Bitbucket repository credentials
    bitbucket_conn = codecommit.CfnRepository.ConnectionArnProperty(
        arn="YOUR_BITBUCKET_CONNECTION_ARN_HERE"
    )

    # Creating an S3 Bucket
    bucket = s3.Bucket(
        self, "MyPipelineBucket",
        bucket_name="my-pipeline-bucket"
    )

    # Creating a CodeCommit Repository
    repository = codecommit.Repository(
        self, "MyRepository",
        repository_name="my-repository-name",
        connection_arn=bitbucket_conn
    )

    # Creating a CodePipeline Artifact Bucket
    artifact_bucket = s3.Bucket(
        self, "MyArtifactBucket",
        bucket_name="my-artifact-bucket"
    )

    #Creating an AWS CodePipeline using the CodeCommit Repository as input
    pipeline = codepipeline.Pipeline(
        self, "MyPipeline",
        pipeline_name="my-pipeline-name",
        artifact_bucket=artifact_bucket
    )

    #Creating a CodeCommit Source Action to retrieve the source code
    source_action = actions.CodeCommitSourceAction(
        action_name="CodeCommit",
        repository=repository,
        output=codepipeline.Artifact("SourceArtifact")
    )

    #Creating a build Action to compile and upload the Spark Jar to S3
    build_action = actions.CodeBuildAction(
        action_name="MyBuild",
        input=codepipeline.Artifact("SourceArtifact"),
        outputs=[codepipeline.Artifact("MyArtifact")],
        project=MyBuildProject

相关内容

热门资讯

第4分钟实锤!德州ai辅助有用... 第4分钟实锤!德州ai辅助有用(德州app)切实真的有挂(详细辅助科技教程);1、上手简单,内置详细...
第6分钟实锤!智星德州菠萝(德... 第6分钟实锤!智星德州菠萝(德扑)果然真的有挂(详细辅助必备教程)1)智星德州菠萝辅助挂:进一步探索...
第5分钟实锤!德扑之星作弊(w... 第5分钟实锤!德扑之星作弊(wpk德州)果然是有挂(详细辅助必赢教程)1)德扑之星作弊辅助挂:进一步...
一分钟实锤!德州ai辅助有用(... 一分钟实锤!德州ai辅助有用(德扑ai)原来真的是有挂(详细辅助新版2025教程);1、打开软件启动...
第2分钟实锤!德扑之星作弊(来... 第2分钟实锤!德扑之星作弊(来玩德州)一直真的有挂(详细辅助玩家教程)1、上手简单,内置详细流程视频...
六分钟实锤!德州ai辅助软件(... 六分钟实锤!德州ai辅助软件(手机德州)其实有挂(详细辅助科技教程)1、玩家可以在德州ai辅助软件软...
3分钟实锤!德扑数据软件(德扑... 3分钟实锤!德扑数据软件(德扑之星)本来有挂(详细辅助攻略教程)进入游戏-大厅左侧-新手福利-激活码...
第1分钟实锤!智星德州菠萝外挂... 第1分钟实锤!智星德州菠萝外挂(德州wpk)总是存在有挂(详细辅助教你教程)暗藏猫腻,小编详细说明智...
9分钟实锤!德扑起手牌胜率图(... 9分钟实锤!德扑起手牌胜率图(德州)确实是有挂(详细辅助AA德州教程);1、金币登录送、破产送、升级...
第1分钟实锤!德扑之星ai代打... 第1分钟实锤!德扑之星ai代打(德州wpk)竟然真的有挂(详细辅助曝光教程)1、玩家可以在德扑之星a...