#!/bin/sh
APP_HOME=$(cd "$(dirname "$0")"; pwd)
TARGET_FILE=/usr/local/somnus/source/ETC_Project/ETC_MANAGE_WEB/target/ETC_MANAGE_WEB-0.0.1-SNAPSHOT.jar #源码编译的文件
WORK_DIR=/usr/local/somnus/server/ETC_MANAGE_WEB #启动之后服务器日志
if [ -f $TARGET_FILE ]; then
rm -rf $TARGET_FILE
fi
cd /usr/local/somnus/source/ETC_Project/ETC_MANAGE_WEB #进入源码目录
svn up
mvn clean package -Dmaven.test.skip=true
if [ -f $TARGET_FILE ]; then
cd $WORK_DIR
./bin/etc_manage_web stop
rm -rf lib/* no*
cp $TARGET_FILE $WORK_DIR/lib
./bin/etc_manage_web start
else
echo "$TARGET_FILE is not exits"
fi
cd $APP_HOME