Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • CbmSoft/cbmroot_input
  • p.-a.loizeau/cbmroot_input
  • f.uhlig/cbmroot_input
  • d.emschermann/cbmroot_input
  • e.clerkin/cbmroot_input
  • apuntke/cbmroot_input
6 results
Show changes
Commits on Source (8)
stages:
- checkFormat
FileFormatCheck:
stage: checkFormat
tags:
- CbmRoot
only:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "cbmsoft/cbmroot_input" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
- .scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
- git fetch upstream
- .scripts/check-file-format.sh upstream
#FileFormat:
# stage: checkFormat
# image: alpine
# tags:
# - docker
#!/bin/bash
if [[ $# -eq 1 ]]; then
UPSTREAM=$1
else
if [ -z $UPSTREAM ]; then
UPSTREAM=$(git remote -v | grep git.cbm.gsi.de[:/]computing/cbmroot | cut -f1 | uniq)
if [ -z $UPSTREAM ]; then
echo "Error: Name of upstream repository not provided and not found by automatic means"
echo 'Please provide if by checking your remotes with "git remote -v" and exporting UPSTREAM'
echo "or passing as an argument"
exit -1
fi
fi
fi
echo "Upstream name is :" $UPSTREAM
BASE_COMMIT=$UPSTREAM/master
CHANGED_FILES=$(git diff --name-only $BASE_COMMIT)
for file in $CHANGED_FILES; do
result=$(file $file | grep CRLF)
if [[ "$result" != "" ]]; then
echo ""
echo "File $file has wrong file format"
echo "$result"
echo ""
okay=false
fi
done
if [[ "$okay" = "false" ]]; then
echo ""
echo "Not all files have the correct file format"
echo "Test failed"
exit 1
else
exit 0
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