Skip to content
Snippets Groups Projects
Commit d0f2a773 authored by Administrator's avatar Administrator
Browse files

Fix the code checker

Only run the piplines when there is a MR to the master branch.
Properly connect the official CbmRoot repository for the format checker
such that the differing source files can be found.
Add a shell script to do this.
parent 085c8f9e
No related branches found
No related tags found
1 merge request!40Fix the code checker
......@@ -65,8 +65,12 @@ FormatCheck:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot"
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparisson
- scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
- git fetch upstream
- echo "export FAIRSOFT_VERSION=jun19p1" > env.sh
- echo "export FAIRROOT_VERSION=v18.2.0" >> env.sh
- echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> env.sh
......@@ -75,6 +79,7 @@ FormatCheck:
- echo "export SOURCEDIR=$PWD" >> env.sh
- echo "export PATH=/cvmfs/fairroot.gsi.de/clang-format-8.0.1:\$SIMPATH/bin:$PATH:/cvmfs/it.gsi.de/compiler/llvm/6.0.1/bin/" >> env.sh
- echo "export LABEL=format-check_MR-\${CI_MERGE_REQUEST_IID}" >> env.sh
- echo "export FAIRROOT_FORMAT_BASE=upstream/\${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" >> env.sh
- . ./env.sh && ctest -S cmake/scripts/checkformat.cmake -VV
CbmRoot_Merge:
......@@ -85,7 +90,7 @@ CbmRoot_Merge:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot"
- $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script:
- echo $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH
- echo $CI_MERGE_REQUEST_PROJECT_PATH
......
......@@ -14,4 +14,3 @@ else
echo "$RESULT"
exit 1
fi
#!/bin/bash
upstream_repo=$1
bla=$(git remote -v | grep upstream)
if [ $? -eq 0 ]; then
echo "Remote link upstream already exist"
bla=$(git remote -v | grep upstream | grep $upstream_repo)
if [ $? -eq 0 ]; then
echo "Remote link upstream already exist and points to the correct repo"
# dont do anything
else
echo "Remote link upstream already exist and points to the wrong repo"
git remote rm upstream
git remote add upstream $upstream_repo
fi
else
echo "Remote repo has to be connected"
git remote add upstream $upstream_repo
fi
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