繁体   English   中英

如何通过 aws lambda(python) 更改 AWS codepipeline 的源分支?

[英]how to change the source branch of the AWS codepipeline through aws lambda(python)?

使用 AWS 代码管道,在源代码中我配置了一个回购分支(使用 bitbucket 回购)并发布了它将构建和部署的管道。 我曾经通过编辑管道手动更改源分支。 现在我想通过 aws lambda(python) 来做到这一点。 面对“client.update_pipeline”的麻烦。 这是正确的方法还是我应该怎么做? https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/codepipeline.html#CodePipeline.Client.update_pipeline https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdatePipeline .html

我想通过 aws lambda(python) 从同一个 repo(bitbucket) 更改管道的源分支

是的,您可以在 Lambda 中使用 Python 的 boto3 来更新管道的源分支:

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/codepipeline.html

response = client.update_pipeline(
    name=your_pipeline,
    stage_variables={
        'BranchName': {
            'variable_value': new_branch
        }
    }
)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM