zoukankan      html  css  js  c++  java
  • checker jenkins 启动配置

    chmod -R 755 bin
    scp target/*.jar ubuntu@x:/home/ubuntu/checker/
    scp config/*.yml ubuntu@x:/home/ubuntu/checker/
    scp bin/* ubuntu@x:/home/ubuntu/checker/
    ssh ubuntu@x "/home/ubuntu/checker/shutdown"
    ssh ubuntu@x "/home/ubuntu/checker/launch" > /dev/null 2>&1 &
    sleep 1
    chmod -R 755 bin
    scp bin/* ubuntu@192.168.8.x:/home/ubuntu/checker/
    
    ssh ubuntu@x.x "/home/ubuntu/checker/shutdown"
    ssh ubuntu@x.x "/home/ubuntu/checker/preboot"
    scp target/*.jar ubuntu@x:/home/ubuntu/checker/
    ssh ubuntu@x.x "/home/ubuntu/checker/launch test" > /dev/null 2>&1 &
    sleep 1

    launch

    #!/bin/bash
    cd /home/ubuntu/checker/
    echo ">>> launch begin"
    if [ -z "$1" ]; then
        echo "profile is not assign. eg: launch test, launch production "
        exit  1
    fi
    echo ">>> launch $1"
    ./startup "$1"

    preboot

    #!/bin/bash
    echo ">>> pre boot begin"
    if [ ! -d /home/ubuntu/checker/archive  ];then
      mkdir -p /home/ubuntu/checker/archive
    else
      echo "archive exist"
    fi
    mv /home/ubuntu/checker/*.jar /home/ubuntu/checker/archive/
    echo ">>> pre boot end"

    shutdown

    #!/bin/bash
    PID=`ps -ef | grep java | grep checker* | awk '{print $2}'`
    echo ">>> shutdown begin "
    if [ -z "$PID" ]; then
        echo "checker not started"
    else
        kill ${PID} > /dev/null 2>&1
        echo ">>> shutdown success, pid ${PID}"
    fi

    startup

    #!/bin/bash
    echo ">>> startup profile $1 begin"
    nohup java -jar /home/ubuntu/checker/*.jar --spring.profiles.active=$1 /dev/null 2>&1 &
    echo ">>> startup profile $1 end"
  • 相关阅读:
    python模块之random模块
    python模块之os模块
    python模块之collections模块
    python模块之re模块
    python基础十五之递归函数
    python基础十四之匿名函数
    python基础十三之内置函数
    leetcode 108 和leetcode 109 II
    leetcode 108 和leetcode 109
    对于final修饰的类型运算时的表现
  • 原文地址:https://www.cnblogs.com/exmyth/p/13209175.html
Copyright © 2011-2022 走看看