diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64d2672d731fc2a329b7ff9a55b6d818b81699c3..6ef4e62c9c8365db2b121571e2468a43a5448e2b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 @@ -26,8 +27,8 @@ RebaseCheck: - apk update && apk add git bash - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL - git fetch upstream - - hash1=$(git show-ref upstream/master | cut -f1 -d' ') - - hash2=$(git merge-base upstream/master HEAD) + - 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 @@ -51,6 +52,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 @@ -59,7 +61,7 @@ LinearHistCheck: - apk update && apk add git bash - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL - git fetch upstream - - count=$(git rev-list --min-parents=2 --count upstream/master..HEAD) + - count=$(git rev-list --min-parents=2 --count upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME..HEAD) - echo "${count}" - if [ 0 = "${count}" ]; then - echo "History introduced in fork is linear" @@ -79,6 +81,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 +144,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 +163,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 +183,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 +523,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