
#cd 
#
#cd /root/loanmaster/
#
#git pull 
#
#cd /root/loanmaster/parent/
#
##印度生产的包 amazonProd
#mvn clean install -Dmaven.test.skip=true -Dproject.environment=amazonProd


rm -rf /root/package/*


#复制包
#cp /root/loanmaster/api-impl/target/api-impl.jar /root/package/
#cp /root/loanmaster/web/installment/target/installment.war /root/package/
#cp /root/loanmaster/web/manage/target/manage.war /root/package/
#cp /root/loanmaster/web/task/target/task.war /root/package/

cp /home/loanmaster/api-impl-1.0-SNAPSHOT-fat.jar /root/package/api-impl.jar
cp /home/loanmaster/installment.war /root/package/installment.war
cp /home/loanmaster/manage.war /root/package/manage.war
cp /home/loanmaster/task.war /root/package/task.war


#删除包
rm -rf /root/tomcat-loanmaster-installment/webapps/*
rm -rf /root/tomcat-loanmaster-manage/webapps/*
rm -rf /root/tomcat-loanmaster-task/webapps/*


#删除进程
ps -ef  | grep java | grep loanmaster | awk '{print $2}' | xargs kill -9

#拷贝包
cp /root/package/installment.war       /root/tomcat-loanmaster-installment/webapps/ROOT.war
cp /root/package/manage.war            /root/tomcat-loanmaster-manage/webapps/ROOT.war
cp /root/package/task.war              /root/tomcat-loanmaster-task/webapps/ROOT.war





#赋予权限
chmod +x /root/package/api-impl.jar

#启动提供者
nohup  java -server -Xms2g -Xmn256m -Xmx2g -Xss256k -XX:PermSize=128m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -jar /root/package/api-impl.jar --name=loanmaster-api-impl-44444 --server.port=44444 &

#等40秒
sleep 50

#启动
/root/tomcat-loanmaster-installment/bin/startup.sh restart &
/root/tomcat-loanmaster-manage/bin/startup.sh restart &
/root/tomcat-loanmaster-task/bin/startup.sh restart &

cd 
