【问题标题】:How can I get branch name in aws codebuild for bitbucket?如何在 aws codebuild 中为 bitbucket 获取分支名称?
【发布时间】:2021-09-24 00:05:28
【问题描述】:

我使用 bitbucket 作为代码存储库和用于 CI/CD 的 Aws 代码构建/管道。

CODEBUILD_SOURCE_VERSION env 的值是多少。用于bitbucket的aws codebuild中的变量?

【问题讨论】:

    标签: continuous-integration aws-codepipeline aws-codebuild


    【解决方案1】:

    要在构建步骤中获取分支名称,请使用环境变量功能。

    在Build步骤中添加一个环境变量(Key:BRANCH,Value:#{SourceVariables.BranchName}),然后这个变量就可以像$BRANCH一样在build script里面调用

    See this for more details

    【讨论】:

      【解决方案2】:

      就我而言,

      我的管道有一个源部分,它从 bitbucket 复制并存储在 s3 中。

      我有一个源工件作为 s3 存储桶。所以它会返回 s3 ARN。

      源码版本arn:aws:s3:::codepipeline-<region>-<accountnumber>/<path>

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-09-21
        • 2022-11-11
        • 2019-11-26
        • 2018-05-04
        • 1970-01-01
        • 2016-03-18
        • 2011-09-08
        相关资源
        最近更新 更多