diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 31e5ba1a247..e3731186247 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -157,7 +157,7 @@ include: .build-rules: rules: # Don't run when disabling a farm - - !reference [.disable-farm-rules, rules] + - !reference [.disable-farm-mr-rules, rules] # If any files affecting the pipeline are changed, build/test jobs run # automatically once all dependency jobs have passed - changes: &all_paths @@ -201,7 +201,7 @@ include: .container-rules: rules: # Don't run when disabling a farm - - !reference [.disable-farm-rules, rules] + - !reference [.disable-farm-mr-rules, rules] # Run pipeline by default in the main project if any CI pipeline # configuration files were changed, to ensure docker images are up to date - if: *is-post-merge diff --git a/.gitlab-ci/farm-rules.yml b/.gitlab-ci/farm-rules.yml index 0f6619c9061..0b0562273c0 100644 --- a/.gitlab-ci/farm-rules.yml +++ b/.gitlab-ci/farm-rules.yml @@ -239,11 +239,12 @@ # Skip container & build jobs when disabling any farm -.disable-farm-rules: +# Only apply these rules in MR context, because otherwise we get a false +# positive on files being 'created' when pushing to a new branch, and break +# our pipeline +.disable-farm-mr-rules: rules: # changes(disabled) + exists(disabled) = disabling the farm - # only run in MR context, because otherwise we get a false positive on - # files being 'created' when pushing to a branch, and nuke our pipeline - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' changes: [ .ci-farms-disabled/microsoft ] exists: [ .ci-farms-disabled/microsoft ]