In this blog, we are going to discuss how to manage and deploy multiple pipelines from the single code base BUT different version control branches. Assuming that you know the basics of how to use codepipeline. click here if you want to know how to use codepipeline.
- Version Control: Git
- Server: AWS stack (Fargate)
How to deploy to different environments?
Lets assume we have code base in GitHub and as of now we have single branch (named as master). Now Follow the below steps:
Add different branches for different environments?
Add branch for each environment is recommended for best practice and hooks BUT still if you want same branch in all then also you can proceed.
Add buildspec.yaml for each environment?
For multiple environment you are required to add buildspec.yaml for each of them, for example – prod-buildspec.yaml, dev-buildspec.yaml, and buildspec.yaml.
Create a pipeline and Create a project for each of them and remember to specify <env>-buildspec.yaml file while creating the project.
Finally use respective container name in buildspec.yaml files