summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-04-13 15:03:16 +0200
committerThomas Haller <thaller@redhat.com>2023-04-13 15:19:23 +0200
commit7fa72645e5b4eebf299ebdb16b83be4e242b8822 (patch)
tree07ee6275856e5d5e89b3341c0bec36da06b55dbe
parent31b5bd72ebfc3c77ce3d80aaaaa06f1944dc7213 (diff)
downloadNetworkManager-7fa72645e5b4eebf299ebdb16b83be4e242b8822.tar.gz
gitlab-ci: make detached MR pipeline for external contributor's pipelines to run
The permissions for running CI will be restricted to external contributors. It will only work for projects that use "detached MR pipelines" ([1]). Note that for it to actually work, a member with permission might have to go to the "pipeline" tab of the merge request and click "run pipeline". But this snippet is necessary for that. [1] https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
-rw-r--r--.gitlab-ci.yml19
-rw-r--r--.gitlab-ci/ci.template7
2 files changed, 20 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 437f1961e1..013835f1bd 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -57,11 +57,11 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
- ALPINE_TAG: 'tag-c6ac275362b2'
- CENTOS_TAG: 'tag-80e000f258af'
- DEBIAN_TAG: 'tag-f961edd7a574'
- FEDORA_TAG: 'tag-80e000f258af'
- UBUNTU_TAG: 'tag-f961edd7a574'
+ ALPINE_TAG: 'tag-20ccfc6f0a87'
+ CENTOS_TAG: 'tag-cdc72bd04206'
+ DEBIAN_TAG: 'tag-bc68fd50d074'
+ FEDORA_TAG: 'tag-cdc72bd04206'
+ UBUNTU_TAG: 'tag-bc68fd50d074'
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'
CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh'
@@ -1117,4 +1117,11 @@ triage:issues:
- gem install gitlab-triage
- gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID
only:
- - schedules \ No newline at end of file
+ - schedules
+
+# Have detached MR pipeline (https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html)
+# https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
+workflow:
+ rules:
+ - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
+ - if: $CI_PIPELINE_SOURCE == 'push' \ No newline at end of file
diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template
index a62e9e58e4..a9bb6d4f47 100644
--- a/.gitlab-ci/ci.template
+++ b/.gitlab-ci/ci.template
@@ -286,3 +286,10 @@ triage:issues:
- gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID
only:
- schedules
+
+# Have detached MR pipeline (https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html)
+# https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
+workflow:
+ rules:
+ - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
+ - if: $CI_PIPELINE_SOURCE == 'push'