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
#
# 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
#
# It's also possible to update with custom repo and branch by:
# $ sh update-bundled-web-ui.sh ../my-custom-web-ui-repo/
# It's also possible to update with custom 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 )"
GNS3SERVER_DIR=$(realpath "$CURRENT_DIR/..")
REPO_DIR="/tmp/gns3-web-ui"
CUSTOM_REPO=false
if [ $# -eq 1 ]; then
PARAM="$1"
CUSTOM_REPO=true
REPO_DIR=$(realpath "$PWD/${PARAM%/}")
echo "Custom repo dir: $REPO_DIR"
fi
for i in "$@"
do
case $i in
-r=*|--repository=*)
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/*"
@ -52,6 +72,13 @@ if [ "$CUSTOM_REPO" = false ] ; then
else
cd "$REPO_DIR"
git pull
if [[ ! -z "$TAG" ]]
then
echo "Switching to tag: ${TAG}"
git checkout "tags/${TAG}"
fi
cd "$CURRENT_DIR"
fi
fi