服务器发布脚本
来源:互联网 发布:淘宝登录界面刷不出来 编辑:程序博客网 时间:2024/06/16 16:19
#! /bin/bash
# ./start.sh projectName git [all,war] [debug]
PROJECT_NAME=signin
TOMCAT=/data/www/tomcat/${PROJECT_NAME}
PROJECT=/data/git/client/client-web/client-web-${PROJECT_NAME}
if [ ! -d ${PROJECT} ]; then
echo ${PROJECT} is not exsits
exit -1
fi
if [ "$2" == "git" ]; then
git reset --hard
git checkout signin-dev-1.1.8
git pull
cp /home/lightapp/properties/jdbc.properties /data/git/client/client-commons/client-commons-base/src/main/resources/config/jdbc.properties
cp /home/lightapp/properties/spring-redis.xml /data/git/client/client-commons/client-commons-util/client-commons-cache-util/src/main/resources/spring/spring-redis.xml
cp /home/lightapp/properties/base_logback.xml /data/git/client/client-commons/client-commons-base/src/main/resources/log/base_logback.xml
if [ "$3" == "all" ]; then
mvn clean; mvn package;
else
web_pom=client-web/pom.xml
sed -in '/client-web-/d' ${web_pom}
sed -in "s/<\/modules>/<module>client-web-$1<\/module><\/modules>/" ${web_pom}
buz_pom=client-business/pom.xml
sed -in '/client-business-/d' ${buz_pom}
sed -in "s/<\/modules>/<module>client-business-$1<\/module><\/modules>/" ${buz_pom}
if [ "$4" == "debug" ]; then
sed -in 's/"info"/"debug"/g' ./client-commons/client-commons-base/src/main/resources/log/base_logback.xml
elif [ "$4" == "info" ]; then
sed -in 's/"debug"/"info"/g' ./client-commons/client-commons-base/src/main/resources/log/base_logback.xml
fi
mvn clean; mvn package;
git checkout -- ${web_pom}
git checkout -- ${buz_pom}
rm -rf ${web_pom}n
rm -rf ${buz_pom}n
fi
fi
pid=`ps -ef | grep java | grep tomcat | grep ${PROJECT_NAME} | awk '{print $2}'`
echo $pid
if [ "$pid" == "" ]; then
echo "pid is null"
else
`kill -9 $pid`
fi
rm -rf ${TOMCAT}/temp/*
rm -rf ${TOMCAT}/work/*
if [ "$3" == "war" ]; then
rm -rf ${TOMCAT}/webapps/*
cp ${PROJECT}/target/${PROJECT_NAME}.war ${TOMCAT}/webapps/
else
rm -rf ${TOMCAT}/webapps/${PROJECT_NAME}/WEB-INF/*
cp -r ${PROJECT}/target/${PROJECT_NAME}/WEB-INF ${TOMCAT}/webapps/${PROJECT_NAME}/
fi
${TOMCAT}/bin/startup.sh
git reset --hard
#git checkout dev
# ./start.sh projectName git [all,war] [debug]
PROJECT_NAME=signin
TOMCAT=/data/www/tomcat/${PROJECT_NAME}
PROJECT=/data/git/client/client-web/client-web-${PROJECT_NAME}
if [ ! -d ${PROJECT} ]; then
echo ${PROJECT} is not exsits
exit -1
fi
if [ "$2" == "git" ]; then
git reset --hard
git checkout signin-dev-1.1.8
git pull
cp /home/lightapp/properties/jdbc.properties /data/git/client/client-commons/client-commons-base/src/main/resources/config/jdbc.properties
cp /home/lightapp/properties/spring-redis.xml /data/git/client/client-commons/client-commons-util/client-commons-cache-util/src/main/resources/spring/spring-redis.xml
cp /home/lightapp/properties/base_logback.xml /data/git/client/client-commons/client-commons-base/src/main/resources/log/base_logback.xml
if [ "$3" == "all" ]; then
mvn clean; mvn package;
else
web_pom=client-web/pom.xml
sed -in '/client-web-/d' ${web_pom}
sed -in "s/<\/modules>/<module>client-web-$1<\/module><\/modules>/" ${web_pom}
buz_pom=client-business/pom.xml
sed -in '/client-business-/d' ${buz_pom}
sed -in "s/<\/modules>/<module>client-business-$1<\/module><\/modules>/" ${buz_pom}
if [ "$4" == "debug" ]; then
sed -in 's/"info"/"debug"/g' ./client-commons/client-commons-base/src/main/resources/log/base_logback.xml
elif [ "$4" == "info" ]; then
sed -in 's/"debug"/"info"/g' ./client-commons/client-commons-base/src/main/resources/log/base_logback.xml
fi
mvn clean; mvn package;
git checkout -- ${web_pom}
git checkout -- ${buz_pom}
rm -rf ${web_pom}n
rm -rf ${buz_pom}n
fi
fi
pid=`ps -ef | grep java | grep tomcat | grep ${PROJECT_NAME} | awk '{print $2}'`
echo $pid
if [ "$pid" == "" ]; then
echo "pid is null"
else
`kill -9 $pid`
fi
rm -rf ${TOMCAT}/temp/*
rm -rf ${TOMCAT}/work/*
if [ "$3" == "war" ]; then
rm -rf ${TOMCAT}/webapps/*
cp ${PROJECT}/target/${PROJECT_NAME}.war ${TOMCAT}/webapps/
else
rm -rf ${TOMCAT}/webapps/${PROJECT_NAME}/WEB-INF/*
cp -r ${PROJECT}/target/${PROJECT_NAME}/WEB-INF ${TOMCAT}/webapps/${PROJECT_NAME}/
fi
${TOMCAT}/bin/startup.sh
git reset --hard
#git checkout dev
阅读全文
0 0
- 服务器脚本发布失败
- 服务器发布脚本
- 发布脚本
- 发布脚本
- 从VSS自动拉下文件/编译/发布到Linux服务器 一条龙脚本(无人工干预)
- linux服务器上通过shell脚本发布java程序实例详解
- Linux编写Shell脚本自动同步svn并发布maven项目-Linux服务器用户设置
- linux使用shell脚本管理其他服务器Tomcat启动停止、自动发布
- 脚本魔术师发布
- 版本发布脚本
- tomcat 生产发布脚本
- linux 发布脚本
- jar 程序发布脚本
- JENKINS 打包发布脚本
- 简单的发布脚本
- linux发布脚本
- isa2004 服务器的发布
- 自有服务器发布ipa
- MT 191 Request for Payment of Charges, Interest and Other Expenses收费、利息和其他费用支付请求 参考Common Group Mess
- js中文字符的过滤问题
- Dubbo超时重试机制带来的数据重复问题
- 约瑟夫环
- 51nod-1079 中国剩余定理
- 服务器发布脚本
- 仿jquery的几行代码
- 【Fiddler】1代理
- MT n90 Advice of Charges, Interest and Other Adjustments收费、利息和其他调整通知
- android多线程asyncTask与Handler用法
- C++的& 与 *区别(从递归上解释)
- spring boot分页组件
- 2017/9/25工作总结
- 深入浅出Node.js之CommonJS的模块规范