Jenkins部署 - 使用shell脚本后台守护进程运行
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| #!/bin/bash
BUILD_ID=dontKillMe
pid=`ps -ef | grep python3 | grep -v grep | awk -F ' ' '{print $2}'` for p in ${pid[@]}; do kill -9 $p done
if [ -d /root/Jenkins/production ]; then rm -rf /root/Jenkins/production fi
mkdir -p /root/Jenkins/production
cd /root/Jenkins/production
git clone <url>
cd <proj_path>
nohup python3 app.py >/dev/null 2>&1 &
|
向博主反馈问题