Multiple Sources for Codebuild
June 2, 2020
June 2, 2020
I was creating a flow that built out an environment but required source code from another project. As I was pulling code from one repository that had the buildspec in it with the code I needed to execute, I needed code from another repository. So, in this case, I needed two sources. The source with my scripts that I needed to run and the source of a second application.
Initially, I thought I could put the source in the same stage as the build.
The idea was that I could just pull it in ‘laterally’. This didn’t work. Codepipeline wants all source actions to be in the first stage.
So I moved it up to the Source stage.
I also had to edit the CodeBuild project. Because it is accepting two sources, I needed to tell it which one would be the primary. The primary would be the one that had the buildspec I wanted to execute. I had found this link, which gave some explanation on how this all worked.
To make sure it all worked, I added the command
ls -lthr $CODEBUILD_SRC_DIR_NAME_OF_OUTPUT
into my buildspec and then triggered my pipeline and the source code that I needed was there!
Advanced Data Engineering Platform for Cleansing, Preprocessing and Analytics