How to access commitid during CodeDeploy stage of a CodePipeline execution?

0

I have a CodePipeline with a Source (CodeCommit), Build (CodeBuild) and Deploy (CodeDeploy) stage. This is for a Node.js application deploying to an AutoScaling group (Blue/Green). My CodeBuild stage runs a few Gulp scripts to minify CSS and JS files, append the commitid to the filename and then copies them to S3. I can pass the commitid during CodeBuild stage using #{SourceVariables.CommitId}. However, I cannot do the same during my CodeDeploy stage. I need the commitid during the deploy stage so that I can write it to a .env file within the Node.js application route directory. My application uses string interpolation to append ${process.env.COMMIT_ID} to the CSS and JS filenames within the HTML.

已提问 1 年前74 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则