chef/cookbooks/lxc/recipes/setup_database.rb in cloud-toaster-1.1.4 vs chef/cookbooks/lxc/recipes/setup_database.rb in cloud-toaster-1.1.5
- old
+ new
@@ -2,12 +2,17 @@
if platform_family?("debian")
node.set['mysql']['server_root_password'] = "root"
include_recipe "mysql::server"
+ root_dir = File.join(File.dirname(__FILE__), "..","..","..","..")
+
bash 'db_create' do
- code "echo 'create database toaster;' | mysql -u root -p#{node['mysql']['server_root_password']}"
+ code <<-EOH
+ echo 'create database toaster;' | mysql -u root -p#{node['mysql']['server_root_password']}
+ cd #{root_dir}/webapp && ./bin/rake db:migrate RAILS_ENV=development
+EOH
not_if "echo \"show databases;\" | mysql -u root -p#{node['mysql']['server_root_password']} | grep toaster"
end
else
@@ -17,6 +22,5 @@
exit 1
EOH
end
end
-