gitlab-ci: configure rules to enable continuous builds of staged MRs

Configure rules to allow jobs for continuous builds to be enabled on a
project that configures a specific branch this purpose.
This commit is contained in:
Brad King
2020-09-30 12:43:05 -04:00
parent a7afd8d3b0
commit ff72dbfb14
2 changed files with 11 additions and 0 deletions

View File

@@ -49,6 +49,12 @@ endif ()
set(ctest_track "Experimental")
if (NOT "$ENV{CI_MERGE_REQUEST_ID}" STREQUAL "")
set(ctest_track "merge-requests")
elseif (NOT "$ENV{CMAKE_CI_PROJECT_CONTINUOUS_BRANCH}" STREQUAL "" AND "$ENV{CMAKE_CI_PROJECT_CONTINUOUS_BRANCH}" STREQUAL "$ENV{CI_COMMIT_BRANCH}" AND NOT "$ENV{CMAKE_CI_JOB_CONTINUOUS}" STREQUAL "")
if (NOT "$ENV{CMAKE_CI_JOB_HELP}" STREQUAL "")
set(ctest_track "Continuous Help")
else()
set(ctest_track "Continuous")
endif()
elseif ("$ENV{CI_PROJECT_PATH}" STREQUAL "cmake/cmake")
if ("$ENV{CI_COMMIT_REF_NAME}" STREQUAL "master")
set(ctest_track "master")

View File

@@ -4,6 +4,9 @@
rules:
- if: '$CMAKE_CI_PACKAGE == "true"'
when: never
- if: '($CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != "" && $CI_COMMIT_BRANCH == $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true")'
when: delayed
start_in: 5 minutes
- if: '$CI_MERGE_REQUEST_ID'
when: manual
- if: '$CI_PROJECT_PATH == "cmake/cmake"'
@@ -15,6 +18,8 @@
rules:
- if: '$CMAKE_CI_PACKAGE == "true"'
when: never
- if: '($CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != "" && $CI_COMMIT_BRANCH == $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true")'
when: on_success
- if: '$CI_MERGE_REQUEST_ID'
when: on_success
- if: '$CI_PROJECT_PATH == "cmake/cmake"'