I'd like to create a deployment pipeline triggered on PR creation that would deploy to e.g. 'staging1' environment if it's my commit and 'staging2' if it's a commit of other team member (the idea is for each team member to have his/her own environment assigned, but deploy using a shared parametrized pipeline). Is it possible to achieve this and if so, then how?
the idea is for each team member to have his/her own environment assigned, but deploy using a shared parametrized pipeline
- You could use definitions for the steps for each environment.
definitions: steps: - step: deploy to staging1 script: - echo "Staging 1" - step: deploy to staging2 script: - echo "Staging 2"
- Then just express each colleague branch and restrict his commits to just this branch. For each of the branches you could call your needed definitions.
branches: #these will run on every push of the branch feature/john.b: - step: # call needed definition step/s feature/pavel.m: # call needed definition step/s
This gives u flexibility to express multiple definitions steps for one person if needed.