0
我創建了一個GitHub庫爲我簡單的定製配方:如何在AWS OpsWorks上運行我的自定義食譜?
laravel/
|- recipes/
| - deploy.rb
|- templates/
|- default
| - database.php.erb
我已經添加了回購協議自定義廚師食譜爲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
當我登錄到該實例通過SSH與Ubuntu的用戶,應用程序/存儲文件夾的權限不改變& app/config/database.php
不填充數據庫的詳細信息。
我錯過了某個關鍵步驟嗎?日誌中沒有錯誤。 配方清楚地識別和加載,但似乎沒有執行。
請不要在stackoverflow和[serverfault](http://serverfault.com/questions/605977/how-do-i-run-my-custom-recipes-on-aws-opsworks)上交叉發佈。 – StephenKing
你能提供廚師的日誌(調試級別)嗎? –
此問題已經出現在[Serverfault](http://serverfault.com/questions/605977/how-do-i-run-my-custom-recipes-on-aws-opsworks) – sethvargo