码迷,mamicode.com
首页 > 其他好文 > 详细

布署脚本

时间:2017-12-13 20:42:35      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:test   text   catalina   没有   stand   utf-8   mda   checkout   分支   

  1 #!/bin/sh
  2 #set var
  3 dir_src="/home/s/projects/site/souche-site"
  4 dir_tomcat_home="/home/s/projects/site/tomcat-30082"
  5
  6 dir_tomcat_bin="$dir_tomcat_home/bin"
  7 dir_tomcat_webapps="$dir_tomcat_home/webapps"
  8 file_war="$dir_src/target/s-site.war"
  9 file_catalina_out="$dir_tomcat_home/logs/catalina.out"
 10 #git update
 11 cd $dir_src
 12 echo "git checkout..."
 13 git add .
 14 git reset —hard         把没有提交的分支给删除了
 15 #git stash 
 16 #git reset --hard
 17 git fetch              以免有的分支拉不下来
 18 #git checkout feature/freyr
 19 #git checkout develop
 20 #git checkout hotfix/duotu
 21 git checkout deploy-test
 22 git pull
 23 #sh eclipse.sh
 24 sh install.sh            
 25 sh script/config_server.sh load -Denv=dev -Dtoken=S0KimGG63z             执行架构组的配置
 26 #kill tomcat
 27 cd $dir_tomcat_home
 28
 29 ps -ef | grep tomcat-30082 | awk ‘{ print $2 }‘ | xargs kill -9        把tomcat的进行杀了
 30
 31 #clear tomcat webapps
 32 cd $dir_tomcat_webapps
 33 rm -rf *  
 34 #cp war
 35 echo "copy war file..."
 36 cp $file_war $dir_tomcat_webapps        复制包
 37 mv s-site.war ROOT.war             改名
 38 #start tomcat
 39 echo "start tomcat..."
 40 cd $dir_tomcat_bin
 41 sh startup.sh            启动
 42 tail -f $file_catalina_out      打印日志

布署脚本

标签:test   text   catalina   没有   stand   utf-8   mda   checkout   分支   

原文地址:http://www.cnblogs.com/chengchengla1990/p/8033931.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!