Loading templates/gitlab-ci-maven.yml +22 −4 Original line number Diff line number Diff line Loading @@ -130,14 +130,23 @@ spec: default: '' --- # default workflow rules: Merge Request pipelines workflow: rules: .tbc-workflow-rules: # prevent MR pipeline originating from production or integration branch(es) skip-back-merge: - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ $PROD_REF || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ $INTEG_REF' when: never # on non-prod, non-integration branches: prefer MR pipeline over branch pipeline # ⚠️ can't be used with next rule prefer-mr-pipeline: - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF' when: never # prefer branch pipeline over MR pipeline # ⚠️ can't be used with previous rule prefer-branch-pipeline: - if: $CI_MERGE_REQUEST_ID when: never # extended "[skip ci]" behavior extended-skip-ci: - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*tag(,[^],]*)*\]/" && $CI_COMMIT_TAG' when: never - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*branch(,[^],]*)*\]/" && $CI_COMMIT_BRANCH' Loading @@ -152,6 +161,15 @@ workflow: when: never - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*dev(,[^],]*)*\]/" && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF' when: never # TBC default rules (MR workflow policy) default: - !reference [.tbc-workflow-rules, skip-back-merge] - !reference [.tbc-workflow-rules, prefer-mr-pipeline] - !reference [.tbc-workflow-rules, extended-skip-ci] workflow: rules: - !reference [.tbc-workflow-rules, default] - when: always # test job prototype: implement adaptive pipeline rules Loading Loading
templates/gitlab-ci-maven.yml +22 −4 Original line number Diff line number Diff line Loading @@ -130,14 +130,23 @@ spec: default: '' --- # default workflow rules: Merge Request pipelines workflow: rules: .tbc-workflow-rules: # prevent MR pipeline originating from production or integration branch(es) skip-back-merge: - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ $PROD_REF || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ $INTEG_REF' when: never # on non-prod, non-integration branches: prefer MR pipeline over branch pipeline # ⚠️ can't be used with next rule prefer-mr-pipeline: - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF' when: never # prefer branch pipeline over MR pipeline # ⚠️ can't be used with previous rule prefer-branch-pipeline: - if: $CI_MERGE_REQUEST_ID when: never # extended "[skip ci]" behavior extended-skip-ci: - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*tag(,[^],]*)*\]/" && $CI_COMMIT_TAG' when: never - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*branch(,[^],]*)*\]/" && $CI_COMMIT_BRANCH' Loading @@ -152,6 +161,15 @@ workflow: when: never - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*dev(,[^],]*)*\]/" && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF' when: never # TBC default rules (MR workflow policy) default: - !reference [.tbc-workflow-rules, skip-back-merge] - !reference [.tbc-workflow-rules, prefer-mr-pipeline] - !reference [.tbc-workflow-rules, extended-skip-ci] workflow: rules: - !reference [.tbc-workflow-rules, default] - when: always # test job prototype: implement adaptive pipeline rules Loading