Skip to content

Commit

Permalink
#2089 always use latest release tag on install sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
rootzoll committed Mar 22, 2021
1 parent d4270ef commit c61c5f2
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions home.admin/config.scripts/bonus.sphinxrelay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,18 +309,34 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
if [ "$2" != "" ]; then
githubUser="$2"
fi
githubBranch="v1.1.3"
githubBranch="master"
if [ "$3" != "" ]; then
githubBranch="$3"
fi
TAG=""
if [ "$4" != "" ]; then
TAG="$3"
fi

# install from GitHub
echo "# get the github code user(${githubUser}) branch(${githubBranch})"
sudo rm -r /home/sphinxrelay/sphinx-relay 2>/dev/null
cd /home/sphinxrelay
sudo -u sphinxrelay git clone https://github.com/${githubUser}/sphinx-relay.git
cd /home/sphinxrelay/sphinx-relay
sudo -u sphinxrelay git checkout ${githubBranch}

# set to latest release tag
sudo -u sphinxrelay git checkout ${githubBranch} || exit 1
sudo -u sphinxrelay git pull || exit 1
if [ "${TAG}" == "" ]; then
TAG=$(git tag | sort -V | tail -1)
fi
if [ "${TAG}" != "ignore" ]; then
echo "# Reset to the latest release tag --> ${TAG}"
sudo -u sphinxrelay git reset --hard $TAG || exit 1
else
echo "# IGNORING release tag .. running latest code of branch ${githubBranch}"
fi

echo "# NPM install dependencies ..."
sudo -u sphinxrelay npm install
Expand Down

0 comments on commit c61c5f2

Please sign in to comment.