开发环境部署脚本

web前端的部署脚本:

current_path=`pwd`
static_home=/opt/yunyingyong/mainsite/mainsite/src/web_js
tomcat_home=/opt/yunyingyong/mainsite/mainsite/apache-tomcat-7.0.53
tomcat_webapp=$tomcat_home/webapps
user_home=/home/oliangdd
cd  $static_home/chanjet_web
sudo $user_home/bin/git.sh -i $user_home/.ssh/id_rsa pull
cd $static_home
echo "delete chanjet_web_build"
sudo rm -fr chanjet_web_build
echo "copy chanjet_web to chanjet_web_build "
sudo cp -r chanjet_web chanjet_web_build
cd $static_home/chanjet_web_build
sudo chmod a+x build.sh
echo "delete mv ./js ./js_src  "
sudo sed -i '/mv[[:space:]]\+.\/js[[:space:]]\+.\/js_src/d' build.sh
sudo ./build.sh
cd $tomcat_webapp
echo "delete $tomcat_webapp/chanjet"
sudo rm -fr $tomcat_webapp/chanjet
#sudo mkdir $tomcat_webapp/chanjet_web_js
echo "copy $static_home/chanjet_web_build to $tomcat_webapp/chanjet"
sudo cp -fr $static_home/chanjet_web_build $tomcat_webapp/chanjet
sudo sed -i "79,82{s/^[[:space:]]*\/\/require(\['lib\/less\/le/require(\['lib\/less\/le/}" $tomcat_webapp/chanjet/js/Application.js
cd $current_path

 

后台部署:

#!/bin/sh
$current_path
current_path=`pwd`
server_home=/opt/yunyingyong/mainsite/mainsite/src/server/chanjet_web
tomcat_home=/opt/yunyingyong/mainsite/mainsite/apache-tomcat-7.0.53
user_home=/home/oliangdd
tomcat_webapp=$tomcat_home/webapps
echo "into $server_home..."
cd  $server_home
echo "update git code..."
#sudo $user_home/bin/git.sh -i $user_home/.ssh/id_rsa checkout master-bug
sudo $user_home/bin/git.sh -i $user_home/.ssh/id_rsa pull
sudo $user_home/bin/git.sh -i $user_home/.ssh/id_rsa branch

echo "execute maven "
mvn clean install -U

echo "stop tomcat ..."
sudo $tomcat_home/bin/shutdown.sh
cd $tomcat_webapp
sudo rm -fr ROOT/
sudo rm -fr ROOT.war

sudo cp -fr $server_home/target/ROOT.war ./
echo "start tomcat"
sudo $tomcat_home/bin/startup.sh

cd $current_path

 

 

 

你可能感兴趣的:(部署脚本,git部署,maven部署)