Reputation: 185
I am trying to set up a build project where I would be able to build various repos with the same build project and push them to the ECR.
Is it possible to make the repo source and branch of AWS CodeBuild project dynamic?
Can it be achieved by using AWS CLI to create the project with variables?
If yes, how can we go about achieving this?
Upvotes: 0
Views: 737
Reputation: 238139
Sadly, it can't be dynamic. The source must be known at CB project creation time. But you can create multiple secondary sources. So instead of only one bitbucket repo, you can create CB project witch has up to 12 secondary sources as well.
You can read more about this in Multiple input sources and output artifacts sample
Alternatively, you can create dynamically new CB project for each repo. But this will create new project for each repo, rather the re-use existing one for new source through some CB specific variable. Similarly, you could programmatically edit a given BP project and change its source to a new one.
Upvotes: 2