In GitLab, I just wan to the merge requests from sit -> uat -> master.
sit -> uat -> master
How can I implement it by pipeline?
You should be albe to use a combination of:
rules:if
workflow:rules
CI_PIPELINE_SOURCE
CI_MERGE_REQUEST_TARGET_BRANCH_NAME
CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
Something like:
sit-to-uat: stage: build image: yourImage script: - # do something rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^sit$/' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^uat$/' when: always
You should be albe to use a combination of:
rules:if, as illustrated inworkflow:rulesCI_PIPELINE_SOURCE: How the pipeline was triggeredCI_MERGE_REQUEST_TARGET_BRANCH_NAME: The target branch name of the merge request.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME: The source branch name of the merge request.Something like: