1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Merge remote-tracking branch 'origin/2.2' into 2.2

This commit is contained in:
grossmj 2019-03-07 18:55:59 +07:00
commit d3ec2a7275

View File

@ -19,24 +19,44 @@
# #
# Syncs WebUI with gns3server # Syncs WebUI with gns3server
# #
# For updating with fresh latest repo just type: # For updating with fresh latest repo just type (latest, development version):
# $ sh update-bundled-web-ui.sh # $ sh update-bundled-web-ui.sh
# #
# It's also possible to update with custom repo and branch by: # It's also possible to update with custom repo:
# $ sh update-bundled-web-ui.sh ../my-custom-web-ui-repo/ # $ sh update-bundled-web-ui.sh --repository ../my-custom-web-ui-repo/
#
# And for proper tag:
# $ sh update-bundled-web-ui.sh --tag 2019.1.0-alpha.0
# #
set -e
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
GNS3SERVER_DIR=$(realpath "$CURRENT_DIR/..") GNS3SERVER_DIR=$(realpath "$CURRENT_DIR/..")
REPO_DIR="/tmp/gns3-web-ui" REPO_DIR="/tmp/gns3-web-ui"
CUSTOM_REPO=false CUSTOM_REPO=false
if [ $# -eq 1 ]; then
PARAM="$1" for i in "$@"
CUSTOM_REPO=true do
REPO_DIR=$(realpath "$PWD/${PARAM%/}") case $i in
echo "Custom repo dir: $REPO_DIR" -r=*|--repository=*)
fi REPOSITORY="${i#*=}"
CUSTOM_REPO=true
REPO_DIR=$(realpath "$PWD/${REPOSITORY%/}")
echo "Custom repo dir: $REPO_DIR"
shift
;;
-t=*|--tag=*)
TAG="${i#*=}"
echo "Using tag: $TAG"
shift
;;
*)
# unknown option
;;
esac
done
echo "Removing: $GNS3SERVER_DIR/gns3server/static/web-ui/*" echo "Removing: $GNS3SERVER_DIR/gns3server/static/web-ui/*"
@ -52,6 +72,13 @@ if [ "$CUSTOM_REPO" = false ] ; then
else else
cd "$REPO_DIR" cd "$REPO_DIR"
git pull git pull
if [[ ! -z "$TAG" ]]
then
echo "Switching to tag: ${TAG}"
git checkout "tags/${TAG}"
fi
cd "$CURRENT_DIR" cd "$CURRENT_DIR"
fi fi
fi fi