diff --git a/sample.xo-install.cfg b/sample.xo-install.cfg index b4f8459..16195c3 100644 --- a/sample.xo-install.cfg +++ b/sample.xo-install.cfg @@ -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 diff --git a/xo-install.sh b/xo-install.sh index 2ee01bb..be2b8df 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -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'"