python - 从 post-recieve 启动 python 文件
问题描述
我有这个接收后挂钩
#!/bin/bash
while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [[ $ref =~ .*/master$ ]];
then
echo "Master ref received. Deploying master branch to production..."
git --work-tree=/home/prod/app --git-dir=/home/prod/chat.git/ checkout -f
killall python3 &
python3 /home/prod/app/server/server.py &
else
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
fi
done
运行并检查正常,但 server.py 进程要么未启动,要么之后不会继续运行。有什么方法可以从钩子中启动 python 脚本并保持运行?
解决方案
推荐阅读
- r - 通过因子变量的模式或其他方式填充geom_tile以在R中创建热图
- excel - 如何让列表框将范围内的结果返回到下一个空行中。每次选择另一个单元格
- java - 如何用单个替换字符串中的多个斜杠和反斜杠?
- javascript - 分屏两次以上按钮
- java - 线程“main”java.lang.IllegalStateException 中的异常:未找到此类型的数据。首先使用 containsData 进行检查
- c++ - 从文件中读取大内容并将该内容写入新文件
- java - 我如何测试 Solr SearchComponent - JUnit 测试
- python - 在圆形OpenCV内绘制文本
- angular - 如何在角度7中将字符串Base64转换为pdf
- build - 如何仅在控制台上在 Linux 上构建 FSharp 程序?