在CodePipeline中获取提交ID(Getting Commit ID in CodePipeline)
我在CodePipeline使用CodeCommit 。 使用push to master分支自动触发构建。 在CodePipeline控制台中,我清楚地看到我正在接收提交ID,但我需要在构建环境中获取它,因此我可以在构建它时将它们作为标记添加到ECS图像。 有没有办法进入构建环境。
I am using CodePipeline with CodeCommit. Builds are triggered automatically with push to master branch. In CodePipeline console it is clearly visible that i am receiving commit id but i need to get it in the build environment so i can add them as a tag to the ECS image when i build it. Is there a way to get in in build environment.
最满意答案
您可以使用CODEBUILD_RESOLVED_SOURCE_VERSION环境变量来检索构建时CodePipeline中显示的提交哈希。
You can use the CODEBUILD_RESOLVED_SOURCE_VERSION environment variable to retrieve the commit hash displayed in CodePipeline at build time.
更多推荐
发布评论