1.get code 2.替换配置文件 3.BUILD 4.SCP 5.deploydaxiang
1> get code ssh://git@git.jc:2222/elephant_bg/daxiang.git
ssh root@10.0.31.120 ####登录到编译的机器cd /opt/daxiang ####代码路径git pull ####拉取最新的代码git branch -a ###查看当前分支git checkout xxx ###切换到要发布的分支xxx
2>替换配置文件\cp -rf /data/jconfig/daxiang/build/pre ./build/ ###
3>BUILD rm -rf ~/.m2/repository/com/jcgroup/daxiang/***** mvn clean install -Dmaven.test.skip=true -Pxxx****
4>SCPscp service/facade/target/service-facade-1.0.0.jar root@op01:/opt/daxiang/war ### SCP 到跳板机
5>deployssh op01** ###登陆到跳板机ansible youxiang-daxiang-xxx -s -m copy -a 'src=/opt/daxiang/war/service-facade-1.0.0.jar dest=/home/daxiang/ owner=daxiang group=daxiang backup=yes' ###分发包部署,youxiang-daxiang-xxx替代你要分发的机器ansible youxiang-daxiang-xxx -m shell -a "python /tools/ele.py restart" ####youxiang-daxiang-xxx替代你要发布的机器
customercore
1>get code ssh://git@git.jc:2222/elephant_bg/customercore.git
ssh root@10.0.31.120 ####登录到编译的机器cd /opt/customercore ####代码路径git pull ####拉取最新的代码git branch -a ###查看当前分支git checkout xxx ###切换到要发布的分支xxx
2>修改配置文件
\cp -rf /data/jconfig/customercore/build/pre ./build sed -i '12s/jar/war/g' /opt/customercore/app/web/service/pom.xml #### 将app/web/service pom.xml中<packaging>jar</packaging>替换为<packaging>war</packaging>
3>BUILD
rm -rf ~/.m2/repository/com/jcgroup/daxiang/ mvn clean install -Dmaven.test.skip=true -Pxxx
4>SCP
scp -r service/target/customercore.war root@op01:/opt/customercore/war ### SCP 到跳板机
5>deployssh op01* ###登陆到跳板机ansible youxiang-customercore-xxx -s -m copy -a 'src=/opt/customercore/war/customercore.war dest=/home/customercore/ owner=customercore group=customercore backup=yes' ###分发包部署,youxiang-customercore-xxx替代你要分发的机器**ansible youxiang-customercore-xxx -m shell -a "python /tools/tomcat_customercore.py restart" ####youxiang-customercore-xxx替代你要发布的机器
component
1>mvn clean install -Dmaven.test.skip=true -Pxxx
网友评论