代码拉取完成,页面将自动刷新
同步操作将从 chace0120/shell4jar 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/sh
# description: script for deploy projects
DATE_TIME_NOW=$(date '+%Y-%m-%d %T')
DEPLOY_LOG=/www/deploy.log
declare -A map=(["basic-manage.jar"]="erp_basic" \
["contract-manage.jar"]="erp_contract" \
["customer-manage.jar"]="erp_customer" \
["document-manage.jar"]="erp_document" \
["logbook-manage.jar"]="erp_logbook" \
["ratelog-manage.jar"]="erp_ratelog" \
["transportation-manage.jar"]="erp_transportation" \
["ratelog-htls-src.jar"]="erp_ratelog_htls_src" \
["gocanvas-manage.jar"]="erp_gocanvas" \
["monthly-report-manage.jar"]="erp_report" \
["new-duty-manage.jar"]="erp_new_duty" \
["salesreport-manage.jar"]="erp_sales")
cd /www
echo '******** Deploy Projects Time: '${DATE_TIME_NOW} | tee -a $DEPLOY_LOG
if test -e update.zip
then
unzip update.zip
# deploy projects of service
JAR_FILES_NUM=$(ls *.jar 2>/dev/null | wc -l)
if [ $JAR_FILES_NUM != "0" ]
then
chmod 500 *.jar
cd services/
# get names of jars
for FILE_PATH in ../*.jar
do
FILE_NAME=${FILE_PATH#*"../"}
mv ./$FILE_NAME ../last_services/ && mv ../$FILE_NAME ./
echo '====== Service: '${map[$FILE_NAME]}' restart' | tee -a $DEPLOY_LOG
service ${map[$FILE_NAME]} restart | tee -a $DEPLOY_LOG
done
fi
# deploy projects of front
cd /www
if test -d employee/
then
if test -e employee.zip
then
echo '====== The employee/ is updated' | tee -a $DEPLOY_LOG
rm -rf last_employee/ && mv employee/ last_employee/ && unzip employee.zip && rm -rf employee.zip
fi
else
echo '====== The employee/ is not found' | tee -a $DEPLOY_LOG
fi
if test -d master/
then
if test -e master.zip
then
echo '====== The master/ is updated' | tee -a $DEPLOY_LOG
rm -rf last_master/ && mv master/ last_master/ && unzip master.zip && rm -rf master.zip
fi
else
echo '====== The master/ is not found' | tee -a $DEPLOY_LOG
fi
# clear update zip
rm -rf update.zip
else
echo '====== The update.zip is not found' | tee -a $DEPLOY_LOG
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。