Skip to content

Instantly share code, notes, and snippets.

@cyberswat
Created June 19, 2013 20:32
Show Gist options
  • Save cyberswat/5817791 to your computer and use it in GitHub Desktop.
Save cyberswat/5817791 to your computer and use it in GitHub Desktop.
execute "drush-site-install" do
drupal_user = data_bag_item('users', 'drupal')[node.chef_environment]
install = site[:install]
if site[:database].nil?
cmd = "drush -y site-install #{site[:profile]}"
install.each do |flag, value|
cmd << " #{flag}=#{value}"
end
cmd << " --db-url=mysql://#{drupal_user['dbuser']}:#{drupal_user['dbpass']}@localhost/#{site_name}" if install['db-url'].nil?
cmd << " --account-name=#{drupal_user['admin_user']}" if install['account-name'].nil?
cmd << " --account-pass=#{drupal_user['admin_pass']}" if install['account-pass'].nil?
cwd release_path
command <<-EOF
#{cmd}
EOF
else
puts "beep need to tie into existing db.drush core-config sett"
end
not_if { files_sorted_by_time.length > 1 }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment