我正在使用下面的同步我的github存储库在我的厨师食谱。
branch_name = "master"
git "/home/ubuntu/workspace/repo" do
repository "git@github.com:me/repo.git"
revision branch_name
action :sync
user "root"
end代码库中有我的python web.py脚本,它运行我的spawn-fcgi应用程序。我正在使用runit配方来运行我的spawn-fcgi作业。
include_recipe "runit"
runit_service "myservice"问is..given index.py脚本已经在repo...how中更新了,我是否通知runit scipt myservice重新加载我的spawn-fcgi脚本?
发布于 2012-04-03 20:03:45
如果我理解正确的话,这应该会在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重新加载将被推迟到chef运行结束。要立即执行此操作,可以将最后一行更改为:
notifies :restart, "service[myservice]", :immediatelyrunit_service定义不支持:reload as a operation。请注意,这将在任何时候git版本更改时重新启动服务(因此本地存储库也会更新)。如果您只想监视单个文件,则可能需要编写一个脚本或其他东西来检查更新后的文件,但我怀疑任何git更改都应该重新启动。
https://stackoverflow.com/questions/9991521
复制相似问题