我正在使用以下内容在我的厨师食谱中同步我的github repo.
branch_name = "master"
git "/home/ubuntu/workspace/repo" do
repository "git@github.com:me/repo.git"
revision branch_name
action :sync
user "root"
end
Run Code Online (Sandbox Code Playgroud)
repo是我的python web.py脚本,它运行我的spawn-fcgi应用程序.我正在使用runit配方来运行我的spawn-fcgi作业.
include_recipe "runit"
runit_service "myservice"
Run Code Online (Sandbox Code Playgroud)
问题是...在repo中已经更新了index.py脚本...如何通知runit scipt myservice重新加载我的spawn-fcgi脚本?
如果我理解正确,这应该在git更新后重新加载服务:
branch_name = "master"
git "/home/ubuntu/workspace/repo" do
repository "git@github.com:me/repo.git"
revision branch_name
action :sync
user "root"
notifies :restart, "service[myservice]"
end
Run Code Online (Sandbox Code Playgroud)
重新加载将推迟到厨师运行结束.要立即实现,您可以将最后一行更改为:
notifies :restart, "service[myservice]", :immediately
Run Code Online (Sandbox Code Playgroud)
runit_service定义不支持:reload as a operation.请注意,这将在git版本更改时重新启动服务(因此更新了本地存储库).如果您只想监视单个文件,则可能需要编写脚本或其他内容来检查更新的文件,但我怀疑任何git更改都应该重新启动.
| 归档时间: |
|
| 查看次数: |
2365 次 |
| 最近记录: |