From 3a50e8f68299b88364e70f4123463ecb13337033 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Feb 28 2024 18:26:55 +0000 Subject: Enable merge request pipelines This allows test pipelines to run on merge requests originating from forks. Signed-off-by: Georg Pfuetzenreuter --- diff --git a/.gitlab-ci.templates/test_highstate.jinja b/.gitlab-ci.templates/test_highstate.jinja index 1ad3781..17a8285 100644 --- a/.gitlab-ci.templates/test_highstate.jinja +++ b/.gitlab-ci.templates/test_highstate.jinja @@ -11,7 +11,7 @@ - '*.txt' - 'render/*.txt' rules: - - if: $CI_COMMIT_BRANCH + - when: on_success {% for role in roles %} test_highstate_{{ role }}: diff --git a/.gitlab-ci.templates/test_nginx.jinja b/.gitlab-ci.templates/test_nginx.jinja index ccbf2a8..d4e652f 100644 --- a/.gitlab-ci.templates/test_nginx.jinja +++ b/.gitlab-ci.templates/test_nginx.jinja @@ -10,6 +10,8 @@ when: always paths: - '*.txt' + rules: + - when: on_success {% for role in roles %} test_nginx_{{ role }}: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af4f3f1..8ee632d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,12 +4,16 @@ stages: - test - deploy +.test_mr: + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'production' + .test_common: + extends: + - .test_mr stage: test tags: - docker - rules: - - if: $CI_COMMIT_BRANCH .test_artifacts: artifacts: @@ -77,12 +81,16 @@ test_prometheus: # Dynamically generated jobs prepare_includes: + extends: + - .test_mr script: bin/render_gitlab_ci_includes.py -w artifacts: paths: - .gitlab-ci.includes/*.yml test_highstate: + extends: + - .test_mr needs: - prepare_includes trigger: @@ -92,6 +100,8 @@ test_highstate: strategy: depend test_nginx: + extends: + - .test_mr needs: - prepare_includes trigger: