Skip to content
Snippets Groups Projects
Commit 1f012f96 authored by Benedikt Steinbusch's avatar Benedikt Steinbusch
Browse files

enable pipelines for merge requests

parent f682dc08
Branches
No related tags found
No related merge requests found
......@@ -2,6 +2,19 @@ default:
tags: [ public-docker ]
image: $CI_REGISTRY/easybuild-docker/easybuild-docker/centos8-eb-test:latest
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
variables:
BASE_COMMIT: $CI_MERGE_REQUEST_DIFF_BASE_SHA
TIP_COMMIT: $CI_COMMIT_SHA
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
variables:
BASE_COMMIT: $CI_COMMIT_BEFORE_SHA
TIP_COMMIT: $CI_COMMIT_SHA
check_style:
script:
- export SYSTEMNAME="juwelsbooster" # Make this the default for packages like NVHPC
......@@ -18,12 +31,8 @@ check_style:
- done
- export EASYBUILD_MODULE_NAMING_SCHEME="FlexibleCustomHierarchicalMNS"
- faulty=""
- TARGET_COMMIT=$(git rev-parse origin/$CI_DEFAULT_BRANCH)
# If these 2 are equal that implies an update in-place, not a MR, so the reference SHA has to be the previous one
- if [ $TARGET_COMMIT == $CI_COMMIT_SHA ]; then
- TARGET_COMMIT=$CI_COMMIT_BEFORE_SHA
- fi
- eb_list=$(git diff-tree --no-commit-id -r $TARGET_COMMIT $CI_COMMIT_SHA | awk '{print($5,$6)}' | grep -e '^M' -e '^A' | awk '{print($2)}' | { grep -e "eb\$" || $(which true); })
- printf "Checking changes between base %s (%s) and tip %s (%s)\n" "$BASE_COMMIT" "$(git describe --all --exclude pipeline/* $BASE_COMMIT 2> /dev/null)" "$TIP_COMMIT" "$(git describe --all --exclude pipeline/* $TIP_COMMIT 2> /dev/null)"
- eb_list=$(git diff-tree --no-commit-id -r "$TIP_COMMIT" "$BASE_COMMIT" | awk '$5 ~ /^M|^A/ && $6 ~ /eb$/ {print($6)}')
- echo "List of files to be checked $eb_list"
- for i in $eb_list; do
- echo "Checking $(basename $i) ..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment