forked from princeqjzh/order
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
钱继志
committed
May 31, 2018
1 parent
7751973
commit 32a4cb0
Showing
1 changed file
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,45 @@ | ||
#!/usr/bin/env bash | ||
#!/usr/bin/env bash | ||
#编译+部署order站点 | ||
|
||
#需要配置如下参数 | ||
# 项目路径, 在Execute Shell中配置项目路径, pwd 就可以获得该项目路径 | ||
# export PROJ_PATH=这个jenkins任务在部署机器上的路径 | ||
|
||
# 输入你的环境上tomcat的全路径 | ||
# export TOMCAT_APP_PATH=tomcat在部署机器上的路径 | ||
|
||
### base 函数 | ||
killTomcat() | ||
{ | ||
pid=`ps -ef|grep tomcat|grep java|awk '{print $2}'` | ||
echo "tomcat Id list :$pid" | ||
if [ "$pid" = "" ] | ||
then | ||
echo "no tomcat pid alive" | ||
else | ||
kill -9 $pid | ||
fi | ||
} | ||
cd $PROJ_PATH/order | ||
mvn clean install | ||
|
||
# 停tomcat | ||
killTomcat | ||
|
||
# 删除原有工程 | ||
rm -rf $TOMCAT_APP_PATH/webapps/ROOT | ||
rm -f $TOMCAT_APP_PATH/webapps/ROOT.war | ||
rm -f $TOMCAT_APP_PATH/webapps/order.war | ||
|
||
# 复制新的工程 | ||
cp $PROJ_PATH/order/target/order.war $TOMCAT_APP_PATH/webapps/ | ||
|
||
cd $TOMCAT_APP_PATH/webapps/ | ||
mv order.war ROOT.war | ||
|
||
# 启动Tomcat | ||
cd $TOMCAT_APP_PATH/ | ||
sh bin/startup.sh | ||
|
||
|
||
|