Skip to content
Snippets Groups Projects
Commit 6b2a64b9 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

Fix the CI config for the DC branches

- run MR container building only if target master
- run the Repo and Code quality checks also for DC branches
parent 8419a3fe
No related branches found
No related tags found
1 merge request!1437[DC] Fix the CI config to run MR container building only if target master
Pipeline #24999 passed
......@@ -18,6 +18,7 @@ RebaseCheck:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "/^DC_.*$/"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
......@@ -39,6 +40,39 @@ RebaseCheck:
- exit 1
- fi
RebaseCheckDc:
stage: checkRepository
variables:
GIT_DEPTH: 200
image: alpine
tags:
- docker
only:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "DC_Oct23"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
# Check if a rebase is needed
# If a rebase is needed stop immediately
- apk update && apk add git bash
- scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
- git fetch upstream
- hash1=$(git show-ref upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME | cut -f1 -d' ')
- hash2=$(git merge-base upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD)
- echo "${hash1}"
- echo "${hash2}"
- if [ "${hash1}" = "${hash2}" ]; then
- echo "No rebase required"
- exit 0
- else
- echo "The Merge Request is not up-to-date"
- echo "Rebase is required"
- exit 1
- fi
LinearHistCheck:
stage: checkRepository
variables:
......@@ -51,6 +85,7 @@ LinearHistCheck:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "/^DC_.*$/"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
......@@ -79,6 +114,7 @@ CodeFormatCheck:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "/^DC_.*$/"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
......@@ -141,6 +177,7 @@ FileFormatCheck:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "/^DC_.*$/"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
......@@ -159,6 +196,7 @@ FileEndCheck:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "/^DC_.*$/"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
......@@ -178,6 +216,7 @@ FileLicenceCheck:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "/^DC_.*$/"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
......@@ -517,7 +556,10 @@ CbmRoot_Continuous:
BuildOnlineContainerMR:
stage: package
only:
- merge_requests
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
needs:
- CodeFormatCheck
- FileFormatCheck
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment