Current CICD implementation
We have three deployment environments (i.e. AWS LightSail instance) namely dev, p4d and prod for each microservice
Each deployment environment associated with microservice GIT repo branch i.e. dev branch linked with dev env , p4d branch linked p4d env and master branch with prod env
We have developed AWS CodePipeline for each microservice to manage CICD deployment pipeline.
Current CodePipline Implementation contains with three stages
Stage 1 - Dev Stage mapped with GIT dev branch , so any changes in dev branch , dev deployment should be triggered
Stage 2 - P4D Stage mapped with GIT p4d branch , so any changes in p4d branch , p4d deployment should be triggered
Stage 3 - prod Stage mapped with GIT Master branch , so any changes in master branch , Prod deployment should be triggered
Problem
Whenever we push change code in the git dev branch, CodePipline gets triggered and it deployed all three environments taking the code from respective branches.
Requirement/Solution
We want to control the Codepipleline so as to restrict the deployment based on condition.
For example , if the dev branch is changed then Codepipeline will deploy the dev environment, NOT other environments (P4D, Prod).
This way we will be having singe pipeline for each microservice to manage the CICD for three environment