Created
June 19, 2013 20:32
-
-
Save cyberswat/5817791 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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