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.

asked 10 months ago63 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions