Jenkins部署测试平台框架
执行脚本的备份:
workon flaskscrapy
PIDS_MAIN=`ps -ef|grep AutotestFramework/test_run/main.py|grep -v grep|cut -c 9-15`
if [ "$PIDS_MAIN" != "" ]; then
ps -ef|grep AutotestFramework/test_run/main.py|grep -v grep|cut -c 9-15|xargs kill -9
fi
BUILD_ID=dontKillMe
nohup python /home/code/AutotestFramework/test_run/main.py > /dev/null 2>&1 &
PIDS_RUN=`ps -ef|grep AutotestFramework/test_run/run.py|grep -v grep|cut -c 9-15`
if [ "$PIDS_RUN" != "" ]; then
ps -ef|grep AutotestFramework/test_run/run.py|grep -v grep|cut -c 9-15|xargs kill -9
fi
BUILD_ID=dontKillMe
nohup python /home/code/AutotestFramework/test_run/run.py > /dev/null 2>&1 &
之前没有使用celery
使用celery部署
workon flaskscrapy
cd /home/code
celery multi start -A AutotestFramework.main worker -l info -P threads
技术改变命运