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 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南