Added ability to update only to tagged releases.

This commit is contained in:
Tynan McAuley
2018-11-05 18:35:05 -05:00
parent 2ede089207
commit f87a20acc9
2 changed files with 12 additions and 2 deletions

View File

@@ -7,7 +7,8 @@ PORT="80"
# Base dir for installation and future updates
INSTALLDIR="/etc/xo"
# Git branch or tag (append tags/ before the tag name) where xen-orchestra sources are fetched
# Git branch or tag (append tags/ before the tag name) where xen-orchestra sources are fetched.
# Also, you can set this to "release" to use the latest tagged branch.
BRANCH="master"
# Log path for possible errors

View File

@@ -266,7 +266,16 @@ function InstallXO {
rm -rf "$INSTALLDIR/xo-builds/xen-orchestra-$TIME"
cp -r "$XO_SRC_DIR" "$INSTALLDIR/xo-builds/xen-orchestra-$TIME"
if [[ "$BRANCH" != "master" ]]; then
if [[ "$BRANCH" == "release" ]]; then
cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo
echo "Checking out latest tagged release '$TAG'"
git checkout $TAG 2> /dev/null # Suppress the detached-head message.
cd $(dirname $0)
elif [[ "$BRANCH" != "master" ]]; then
echo
echo "Checking out source code from branch '$BRANCH'"