diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe2819509467a1920c45bcec39a97be7150a003a..8ab2f473b0edd3117ee17a05054896a4e702d7c6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,40 +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 - # 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/master | cut -f1 -d' ') - - hash2=$(git merge-base upstream/master 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 - -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" + - $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 @@ -85,7 +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_.*$/" + - $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 @@ -114,7 +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_.*$/" + - $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 @@ -177,7 +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_.*$/" + - $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 @@ -196,7 +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_.*$/" + - $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 @@ -216,7 +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_.*$/" + - $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