zoukankan      html  css  js  c++  java
  • Jenkins+gitlab发布Django程序

    Jenkins+gitlab发布Django程序

    一、

    二、

    三、shell

    # !/bin/bash
    cd /root/upload_file
    
    #git add .
    #git commit -m 'other'
    # git pull
    
    if [ $mode == "deploy" ];then
        git add .
        git commit -m 'other'
        git checkout $branch
        git pull
        echo "**********************************************"
        echo ‘通过branch部署’
        echo "**********************************************"
    else
        git add .
        git commit -m 'other'
        git reset --hard $tag
        echo "**********************************************"
         echo ‘通过tag部署’
        echo "**********************************************"
    fi
    
    
    PROCESS=`ps -e | grep gunicorn | awk '{printf "%d
    ", $1}'`
    for i in $PROCESS
    do
        echo "Kill the gunicorn process [ $i ]"
        kill -9 $i
    done
    
    
    echo "finish kill"
    
    sleep 3
    
    nohup  /opt/python/bin/gunicorn  upload_pro.wsgi  -b  0.0.0.0:18000 -w 4  > /dev/null &
    
    echo "New project start"
    
    sleep 5
    
    PROCESS=`ps -e | grep gunicorn | awk '{printf "%d
    ", $1}'`
    for i in $PROCESS
    do
        echo "The new gunicorn process [ $i ]"
    done
    
    echo "success"
    

      

  • 相关阅读:
    thinkphp empty标签
    thinkphp present标签
    if标签
    thinkphp 范围标签
    thinkphp 比较标签
    thinkphp switch标签
    thinkphp for标签
    thinkphp foreach标签
    QueryList 来做采集
    thinkphp volist标签
  • 原文地址:https://www.cnblogs.com/xiao-xue-di/p/12719413.html
Copyright © 2011-2022 走看看