zoukankan      html  css  js  c++  java
  • 脚本:将git项目下载到本地并启动

    大致思路:
    从git上clone源代码到本地;
    使用mvn package将源代码达成war/jar包;
    将打好的包放到tomcatpath/webapps/下;
    到tomcatpath/bin/下执行restart.sh脚本重启;


    脚本:

    #!/bin/bash
    {
    flock -n 100
    [ $? -eq 1 ] && { echo -e "33[41;1m wait for deploying... 33[0m"; exit; }
    echo "start to deploy..."
    
    SERVER_PATH=/data/server/merchant-server-8086
    WEBINF_PATH=$SERVER_PATH/webapps/merchant/WEB-INF
    SOURCE_PATH=/data/git/o2o-merchant-web
    TARGET_PATH=$SOURCE_PATH/target
    CLASSES_PATH=$TARGET_PATH/merchant/WEB-INF/classes
    LIB_PATH=$TARGET_PATH/merchant/WEB-INF/lib
    
    WAR_PATH=$TARGET_PATH/merchant.war
    TOMCAT_WAR_PATH=$SERVER_PATH/webapps
    
    rm -rf $SOURCE_PATH
    mkdir $SOURCE_PATH
    git clone -b dev_vettingCredit git@git.wecash.net:o2o/o2o-merchant-web.git $SOURCE_PATH
    
    cd $SOURCE_PATH && mvn clean && mvn package -Ptest -Dmaven.test.skip=true
    
    if [ ! -x "$TARGET_PATH/merchant" ]; then
    echo -e "33[41;1m mvn install failure, please check. 33[0m"
    exit;
    fi
    cd $SERVER_PATH && ./bin/shutdown.sh
    mv $TOMCAT_WAR_PATH/merchant.war $TOMCAT_WAR_PATH/merchant.war_back
    rm -rf $TOMCAT_WAR_PATH/merchant
    cp $WAR_PATH $TOMCAT_WAR_PATH/merchant.war
    
    cd $SERVER_PATH && ./bin/restart.sh
    flock -u 100
    } 100<>~/.deploy_merchant_lock
    
     
  • 相关阅读:
    C#进行图片压缩
    C# ASHX生成验证码图片及校验
    SQL和MYSQL及数据库
    复制项目取消SVN
    SQL获取表结构的字段说明和结构
    SQL如何创建存储过程
    python 自带模块 os模块
    osi七层简介(通俗易懂)
    Python sys模块
    python 的装饰器
  • 原文地址:https://www.cnblogs.com/peanutk/p/8494185.html
Copyright © 2011-2022 走看看