2

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?

1 Answer 1

1
the idea is for each team member to have his/her own environment assigned, but deploy using a shared parametrized pipeline
  1. 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"

  1. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.