From 3620911b2b4ca3f5040649d6fe5136343e0911fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20P=C3=A9tr=C3=A9?= <laurent.petre@cern.ch> Date: Tue, 6 Feb 2024 17:55:58 +0100 Subject: [PATCH] Fix the CI preview feature for the non-developer members It appears that the "Run Pipeline" button in the "Pipeline" tab of the merge requests is enabled only when a pipeline exists in the forked project. There is thus no possibility to deploy the MR to a preview envronment for non-developer members. This commit ensures that a merge request pipeline exists in the forked project. --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a845b74..c7e2315 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -70,6 +70,9 @@ deploy preview: stage: deploy rules: - if: $CI_PROJECT_NAMESPACE == 'cmsgemonline/gem-ops' && $CI_PIPELINE_SOURCE == 'merge_request_event' + when: always + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + when: manual environment: name: preview-$CI_MERGE_REQUEST_IID url: https://cmsgemonline.web.cern.ch/doc/preview-$CI_MERGE_REQUEST_IID @@ -83,7 +86,7 @@ deploy preview:stop: extends: .deploy eos:stop stage: deploy rules: - - if: $CI_PROJECT_NAMESPACE == 'cmsgemonline/gem-ops' && $CI_PIPELINE_SOURCE == 'merge_request_event' + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' when: manual allow_failure: true environment: -- GitLab