敏捷
自动化
BUILD_ID=cw-hms-web-buildnumber
BUILD_ID=DONTKILLME0
ls -ll
echo "################################################################"
echo " the languagescode is ---->${LanguageCode} "
echo ",the langguagesport is --->${LanguagePort}"
echo " the BranchName is ---->${BranchName} "
echo "################################################################"
killall node
echo " kill all nodejs process on linux server the WORKSPACE is --->"$WORKSPACE
cd /opt
./killNode.sh
cnpm i &&
npm start
:<<eof
echo " ##########the languagescode is ############---->${LanguageCode}"
ps -elf|grep node
cd /opt/cloudwisdompmsweb
if [ ! -d "${LanguageCode}" ]; then
echo "file dir is not exsit "
mkdir ${LanguageCode}
else
echo "file dir is exsit,so delete that files... "
rm -rf ${LanguageCode}/* .[^.]*
rm -fr ${LanguageCode}/.
rm -fr ${LanguageCode}/.
rm -fr ${LanguageCode}/.[^.]
rm -fr ${LanguageCode}/*
rm -rf ${LanguageCode}/.[!.]*
fi
eof
mkdir ${LanguageCode}
ls -ll ${LanguageCode}
echo " The languages code is ========>${LanguageCode}"
cd $WORKSPACE
mv -f * .[^.]* /opt/cloudwisdompmsweb/${LanguageCode}/
cd /opt/cloudwisdompmsweb/${LanguageCode}
mv * /opt/${LanguageCode}
cp -rf * grep -E -v "^(exclude_file|exclude_dir)$" ${LanguageCode}/
cd /opt/${LanguageCode}
pm2 stop pm2Production.json
pm2 delete pm2test
pm2 list
ps -elf|grep node
###################################################
BUILD_ID=cw-hms-web-buildnumber
BUILD_ID=DONTKILLME
ls -ll
killall node
echo " the languagescode is ---->${LanguageCode} "
echo " the langguagesport is --->${LanguagePort} "
cd /opt/${LanguageCode}
cd /opt/cloudwisdompmsweb/${LanguageCode}
pwd
rm -rf *.json.gz
delete all .json.gz files on cw-web
if [ "en_us" = "${LanguageCode}" ]; then
echo "#######################################start pm2 en_us service#################"
cd /opt/cloudwisdompmsweb/${LanguageCode}
mv pm2Production.json pm2Production.json.bak
cp /opt/pm2ProductionEnUs.json .
cat pm2ProductionEnUs.json
pm2 stop pm2ProductionEnUs.json
pwd
else
echo "#######################################start pm2 zh_cn service#################"
cd /opt/cloudwisdompmsweb/${LanguageCode}
mv pm2Production.json pm2Production.json.bak
cp /opt/pm2Production.json .
cat pm2Production.json
pm2 stop pm2Production.json
pwd
fi
cd src
mv CONFIG.js CONFIG.js.bak
cp /opt/CONFIG.js .
cat CONFIG.js
change web project rounter rules,system will change no-rountlinks acess.
cd utils
sed -i '1 s/////g' router_helper.js
sed -i '2 s/^////g' router_helper.js
sed -i 's/^[ \t]*//g' router_helper.js
cat router_helper.js
cd ../..
cd /opt/cloudwisdompmsweb/${LanguageCode}
pwd
npm install -g cnpm --registry=https://registry.npm.taobao.org &&
cnpm i &&
export LANGUAGECODE=$LanguageCode &&
export PORT=$LanguagePort &&
npm run build &&
su - root
cnpm i &&
npm run build &&
nohup babel-node ./server.js
cnpm i &&
npm run build &&
npm run build &&
nohup npm run server &
nohup babel-node ./server.js &
pm2 start pm2test.json &&
pm2 start server.js --name 'cw-web-server'
pm2 list
echo " restart all nodejs process on linux server the WORKSPACE is --->"$WORKSPACE
cd /opt
chmod 777 restartNode.sh
ls -ll restartNode.sh
./restartNode.sh
whoami
sudo su - root
cd $WORKSPACE
cnpm i &&
npm run build &&
nohup npm run server &
cnpm i &&
npm start
ps -elf|grep node
whoami
pwd
echo "#######################################stop pm2 service#################"
cd /opt/${LanguageCode}
if [ "en_us" = "${LanguageCode}" ]; then
cd /opt/cloudwisdompmsweb/${LanguageCode}
pm2 stop pm2ProductionEnUs.json
pm2 list
echo "#######################################start pm2 en_us service#################"
pm2 start pm2ProductionEnUs.json
pwd
rm -rf *.json.gz
else
cd /opt/cloudwisdompmsweb/${LanguageCode}
pm2 stop pm2Production.json
pm2 list
echo "#######################################start pm2 zh_cn service#################"
pm2 start pm2Production.json
pwd
rm -rf *.json.gz
fi
cd $WORKSPACE/${LanguageCode}
rm -rf *.json.gz
delete all .json.gz files on cw-web
ls -ll /opt/${LanguageCode}
ps -elf|grep node
pm2 list
网友评论