amazon web services - How do I run my custom recipes on AWS OpsWorks? -
i've created github repo simple custom recipe:
laravel/ |- recipes/ | - deploy.rb |- templates/ |- default | - database.php.erb i've added repo custom chef recipes https://github.com/minkruben/laravel-opsworks.git
i've added laravel::deploy deploy "cycle".
this deploy.rb:
node[:deploy].each |app_name, deploy| if deploy[:application] == "platform" script "set_permissions" 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" source "database.php.erb" mode 0660 grouping 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 file.directory?("#{deploy[:deploy_to]}/current") end end end end when log instance ssh ubuntu user, app/storage folder permission isn't changed & app/config/database.php not populated database details.
am missing critical step somewhere? there no errors in log. recipe recognized , loaded, doesn't seem executed.
with opsworks, have 2 options:
use 1 of amazon's built-in layers, in case deployment recipe provided amazon , can extend amazon's logic hooks: http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-extend-hooks.html use custom layer, in case responsible providing recipes including deployment: http://docs.aws.amazon.com/opsworks/latest/userguide/create-custom-deploy.htmlthe logic have here looks more hook deployment recipe. why? because modifying already-deployed app vs. specifying deployment logic itself. seems suggest using 1 of amazon's built-in layers , amazon providing deployment recipe you.
if above assumption correct, on path #1. re-implementing logic hook should trick.
amazon-web-services chef chef-recipe aws-opsworks
No comments:
Post a Comment