1 Star 1 Fork 1

璀璨星辰/shell4jar

forked from chace0120/shell4jar 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
deploy.sh 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
#!/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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/xpwdm2020/ShellScriptAboutJar.git
git@gitee.com:xpwdm2020/ShellScriptAboutJar.git
xpwdm2020
ShellScriptAboutJar
shell4jar
master

搜索帮助