git linux上自动化打包发布脚本

#!/bin/bash HOME_DIR= "/home/localadmin/" echo "git文件夹是" $HOME_DIR "nono-all" if [ ! -d $HOME_DIR "nono-all" ]; #如果不是一个文件夹 then git config --global credential.helper store if [ $# -ne 1 ]; then echo "usage:sudo ./tomcat_update.sh branchname" exit 0 fi git clone -b $1 http://git.github.com/dzy_v3/nono-all.git nono-all else echo "git文件夹已存在,放行" fi TAR_DIR= "/usr/local/apache-tomcat-8.0.20" GIT_DIR= $HOME_DIR "nono-all/" BK_FILENAME= $BK_DIR "/nono-all" `date +%Y%m%d%H%M%S` ".tar.gz" PUBLISH_DIR= $TAR_DIR "webapps" cd $TAR_DIR cd webapps echo "备份一下原有war包文件" mv nono-web.war bk_nono-web.tar.gz cd $GIT_DIR echo "正在服务器拉取代码........" pwd git pull echo "正在打包代码 ..........." cd nono-parentmvn clean install -Dmaven.test.skip= true cd ../nono-commonmvn clean install -Dmaven.test.skip= true cd ../nono-datamvn clean install -Dmaven.test.skip= true cd ../nono-usermvn clean install -Dmaven.test.skip= true cd ../nono-module-parentmvn clean install -Dmaven.test.skip= true cd ../nono-platformmvn clean install -Dmaven.test.skip= true echo "mvn打包代码完毕 ..........." #rm_cmd='rm -rf '$PUBLISH_DIR'/*' cd $TAR_DIR #到tomcat里面去 ./bin/shutdown.sh echo "等待10秒钟 ..........." sleep 10000 `rm -rf $PUBLISH_DIR /nono-web*``cp -r $HOME_DIR "nono-all/nono-app/nono-web/target/nono-web.war" $PUBLISH_DIR ` echo "移动war包完毕 ..........." ./bin/start.sh echo "tomcat启动完毕........."

你可能感兴趣的:(git linux上自动化打包发布脚本)