updated script to work with both apps
This commit is contained in:
parent
88a9245b51
commit
2d0825fa85
@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
GIT_SERVER="https://censis.visualstudio.com/DefaultCollection/SmartOffice/_git/mDotServer"
|
||||
GIT_FRONTEND="https://censis.visualstudio.com/DefaultCollection/SmartOffice/_git/mDotServer"
|
||||
GIT_BACKEND="http://gitlab.silvrtree.co.uk/martind2000/mqttArchiver.git"
|
||||
NVM="$HOME/.nvm"
|
||||
NVM_VERSION="6.6.0"
|
||||
DEV="$HOME/dev"
|
||||
LIVE="$HOME/live"
|
||||
STAGING="$HOME/staging"
|
||||
SERVER="mDotServer"
|
||||
SERVER="mqttArchiver"
|
||||
FRONT="mdot_server"
|
||||
SWAP="/swapfile"
|
||||
NGINXFILE='mdot';
|
||||
@ -51,9 +52,10 @@ case $i in
|
||||
shift # past argument=value
|
||||
;;
|
||||
-i|--install)
|
||||
UPDATESYSTEM=YES
|
||||
UPDATE=YES
|
||||
NGINX=YES
|
||||
DATABASE=YES
|
||||
#DATABASE=NO
|
||||
INSTALL=YES
|
||||
shift # past argument=value
|
||||
;;
|
||||
@ -80,15 +82,15 @@ if [ ! -d "$DEV" ]; then
|
||||
fi
|
||||
|
||||
if [ ! -d "$LIVE" ]; then
|
||||
mkdir -p $LIVE
|
||||
mkdir -p $LIVE/$SERVER
|
||||
mkdir -p $LIVE/$FRONT
|
||||
fi
|
||||
|
||||
if [ ! -d "$STAGING" ]; then
|
||||
rm -rf $STAGING
|
||||
mkdir -p $STAGING
|
||||
else
|
||||
mkdir -p $STAGING
|
||||
fi
|
||||
mkdir -p $STAGING/$SERVER
|
||||
mkdir -p $STAGING/$FRONT
|
||||
|
||||
|
||||
if [[ $UPDATESYSTEM = "YES" ]]; then
|
||||
@ -161,45 +163,50 @@ fi
|
||||
cd $DEV
|
||||
|
||||
|
||||
|
||||
# Get latest version of smartoffice Admin Server
|
||||
#if [ ! -d "$DEV/$FRONT/.git" ]; then
|
||||
# git clone $GIT_FRONTEND
|
||||
#else
|
||||
# cd $DEV/$FRONT
|
||||
# git pull origin master
|
||||
|
||||
#fi
|
||||
if [[ $UPDATE = "YES" ]]; then
|
||||
fancy_echo "${PURPLE}Updating code...${RESET}"
|
||||
if [ ! -d "$DEV/$SERVER/.git" ]; then
|
||||
git clone $GIT_SERVER
|
||||
else
|
||||
cd $DEV/$SERVER
|
||||
git pull origin master
|
||||
fancy_echo "${PURPLE}Updating code...${RESET}"
|
||||
|
||||
# Get latest version of Front End
|
||||
if [ ! -d "$DEV/$FRONT/.git" ]; then
|
||||
git clone $GIT_FRONTEND
|
||||
else
|
||||
cd $DEV/$FRONT
|
||||
git pull origin master
|
||||
fi
|
||||
|
||||
# Get latest version of Back End
|
||||
|
||||
if [ ! -d "$DEV/$SERVER/.git" ]; then
|
||||
git clone $GIT_SERVER
|
||||
else
|
||||
cd $DEV/$SERVER
|
||||
git pull origin master
|
||||
fi
|
||||
|
||||
# Rebuild front end
|
||||
cd $DEV/$FRONT
|
||||
rsync -uav --exclude .git $DEV/$FRONT/ $STAGING/$FRONT
|
||||
cd $STAGING/$FRONT
|
||||
|
||||
npm install . && npm-install-missing
|
||||
bower install
|
||||
gulp default
|
||||
|
||||
# Rebuild backend end
|
||||
cd $DEV/$SERVER
|
||||
rsync -uav --exclude .git $DEV/$FRONT/ $STAGING/$FRONT
|
||||
cd $STAGING/$FRONT
|
||||
|
||||
npm install . && npm-install-missing
|
||||
bower install
|
||||
|
||||
# Update live versions
|
||||
fancy_echo "${YELLOW}Copying files to LIVE...${RESET}"
|
||||
rsync -uav --exclude .git $STAGING/$SERVER/ $LIVE/$STAGING
|
||||
rsync -uav --exclude .git --exclude app $STAGING/$FRONT/ $LIVE/$FRONT
|
||||
|
||||
fi
|
||||
|
||||
#cd $DEV/$FRONT
|
||||
|
||||
#npm install . && npm-install-missing
|
||||
#bower install
|
||||
|
||||
cd $DEV/$SERVER
|
||||
|
||||
npm install . && npm-install-missing
|
||||
bower install
|
||||
|
||||
gulp default
|
||||
|
||||
|
||||
rsync -uav --exclude .git --exclude app $DEV/$SERVER/ $STAGING
|
||||
|
||||
fi
|
||||
|
||||
# fancy_echo "${YELLOW}Copying files to LIVE...${RESET}"
|
||||
# rsync -uav --exclude .git $STAGING/ $LIVE
|
||||
|
||||
npm set progress=true
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user