Skip to content

Commit

Permalink
fix gitlab script to set prerel version
Browse files Browse the repository at this point in the history
  • Loading branch information
dianagudu committed Jan 18, 2024
1 parent 21dcba6 commit 33b4067
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .gitlab-ci-scripts/set-prerelease-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,29 @@ done
# Get master branch name:
# use origin if exists
# else use last found remote
REMOTES=$(git remote show)
for R in $REMOTES; do
MASTER=$(git remote show "$R" 2>/dev/null \
| sed -n '/HEAD branch/s/.*: //p')
MASTER_BRANCH="refs/remotes/${R}/${MASTER}"
#echo "Master-branch: ${MASTER_BRANCH}"
[ "x${R}" == "xorigin" ] && break
done
MASTER_BRANCH=""
get_master_branch_of_mteam() {
git remote -vv | awk -F[\\t@:] '{ print $1 " " $3 }' | while read REMOTE HOST; do
# echo " $HOST -- $REMOTE"
MASTER=$(git remote show "$REMOTE" 2>/dev/null \
| sed -n '/HEAD branch/s/.*: //p')
MASTER_BRANCH="refs/remotes/${REMOTE}/${MASTER}"
[ "x${HOST}" == "xcodebase.helmholtz.cloud" ] && {
echo "${MASTER_BRANCH}"
break
}
[ "x${HOST}" == "xgit.scc.kit.edu" ] && {
echo "${MASTER_BRANCH}"
break
}
[ "x${REMOTE}" == "xorigin" ] && {
echo "${MASTER_BRANCH}"
break
}
done
}

MASTER_BRANCH=$(get_master_branch_of_mteam)
PREREL=$(git rev-list --count HEAD ^"$MASTER_BRANCH")

# if we use a version file, things are easy:
Expand Down

1 comment on commit 33b4067

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

87.61%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
motley_cue
   __init__.py100%100%100%100%
   __main__.py0%100%100%0%11–12, 3, 6, 8
   _version.py100%100%100%100%
   api.py81.40%100%100%81.40%44–45, 50, 53–54, 59, 65–66
   dependencies.py93.75%100%100%93.75%28, 44
   models.py100%100%100%100%
   static.py33.33%100%100%33.33%38–39, 41–44
motley_cue/apis
   __init__.py100%100%100%100%
   utils.py92.86%100%100%92.86%13
motley_cue/apis/v1
   __init__.py100%100%100%100%
   admin.py100%100%100%100%
   api.py100%100%100%100%
   root.py96.30%100%100%96.30%138
   user.py100%100%100%100%
motley_cue/mapper
   __init__.py59.57%100%100%59.57%105, 112, 119, 127, 134–137, 143–144, 150–151, 157–159, 167, 173, 180–181, 190–191, 195, 198–204, 29–30, 32–33, 36, 38, 56, 93, 99
   authorisation.py91.59%100%100%91.59%138–140, 146, 204, 40, 53, 66, 99
   config.py83.76%100%100%83.76%113, 116–120, 130–138, 153–157, 161–162, 201–204, 213–215, 238, 268, 271–273, 275, 279, 356, 99
   exceptions.py96.88%100%100%96.88%30
   local_user_management.py90.11%100%100%90.11%160–161, 163–167, 74–75
   token_manager.py95.31%100%100%95.31%164, 201, 243, 278, 377, 379, 383, 397, 450–451, 63–64, 68

Please sign in to comment.