Skip to content

Commit

Permalink
feat: Added check for newer version tags on remote (#6054)
Browse files Browse the repository at this point in the history
  • Loading branch information
Finnlife authored Sep 2, 2024
1 parent 0129f84 commit 710cec9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,21 @@ while (($#)); do
exit 3
fi
;;
--check-tags)
echo "Checking remote tags for updates..."
LATEST_TAG_REV=$(git ls-remote --exit-code --quiet --tags origin | tail -1 | cut -f1)
if [ "$?" -ne 0 ]; then
echo "A problem occurred while trying to fetch the latest tag from github."
exit 99
fi
if [[ -z $(git log HEAD --pretty=format:"%H" | grep "${LATEST_TAG_REV}") ]]; then
echo -e "New tag is available.\nThe changes can be found here: https://github.com/mailcow/mailcow-dockerized/releases/latest"
exit 0
else
echo "No updates available."
exit 3
fi
;;
--ours)
MERGE_STRATEGY=ours
;;
Expand Down Expand Up @@ -396,9 +411,10 @@ while (($#)); do
DEV=y
;;
--help|-h)
echo './update.sh [-c|--check, --ours, --gc, --nightly, --prefetch, --skip-start, --skip-ping-check, --stable, -f|--force, -d|--dev, -h|--help]
echo './update.sh [-c|--check, --check-tags, --ours, --gc, --nightly, --prefetch, --skip-start, --skip-ping-check, --stable, -f|--force, -d|--dev, -h|--help]
-c|--check - Check for updates and exit (exit codes => 0: update available, 3: no updates)
--check-tags - Check for newer tags and exit (exit codes => 0: newer tag available, 3: no newer tag)
--ours - Use merge strategy option "ours" to solve conflicts in favor of non-mailcow code (local changes over remote changes), not recommended!
--gc - Run garbage collector to delete old image tags
--nightly - Switch your mailcow updates to the unstable (nightly) branch. FOR TESTING PURPOSES ONLY!!!!
Expand Down

0 comments on commit 710cec9

Please sign in to comment.