【发布时间】:2014-06-19 02:30:12
【问题描述】:
我为我的简单自定义配方创建了一个 GitHub 存储库:
laravel/
|- recipes/
| - deploy.rb
|- templates/
|- default
| - database.php.erb
我已将 repo 添加到 Custom Chef Recipes 中,名称为 https://github.com/minkruben/Laravel-opsworks.git
我已将 laravel::deploy 添加到部署“周期”中。
这是我的 deploy.rb:
node[:deploy].each do |app_name, deploy|
if deploy[:application] == "platform"
script "set_permissions" do
interpreter "bash"
user "root"
cwd "#{deploy[:deploy_to]}/current/app"
code <<-EOH
chmod -R 777 storage
EOH
end
template "#{deploy[:deploy_to]}/current/app/config/database.php" do
source "database.php.erb"
mode 0660
group deploy[:group]
if platform?("ubuntu")
owner "www-data"
elsif platform?("amazon")
owner "apache"
end
variables(
:host => (deploy[:database][:host] rescue nil),
:user => (deploy[:database][:username] rescue nil),
:password => (deploy[:database][:password] rescue nil),
:db => (deploy[:database][:database] rescue nil)
)
only_if do
File.directory?("#{deploy[:deploy_to]}/current")
end
end
end
end
当我使用 ubuntu 用户通过 SSH 登录实例时,app/storage 文件夹权限没有改变,app/config/database.php 没有填充数据库详细信息。
我是否在某处遗漏了一些关键步骤?日志中没有错误。 配方被清楚地识别和加载,但似乎没有被执行。
【问题讨论】:
-
请不要在stackoverflow和serverfault上交叉发帖。
-
能否提供厨师日志(调试级别)?
-
这个问题已经出现在Serverfault
标签: amazon-web-services chef-infra chef-recipe aws-opsworks