Skip to content

Commit

Permalink
- configurable dump file which defaults to dump.sql
Browse files Browse the repository at this point in the history
- use in the shell via environment variable: `DBVERSION= vagrant reload --provision` (to load dump.v3.sql if it exists)
  • Loading branch information
aMoniker committed Nov 20, 2013
1 parent d482bfd commit db290b0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions php-app/recipes/default.rb
Expand Up @@ -49,6 +49,21 @@
action :run
end

dumpfile = "dump.sql"
if ENV.key?('DBVERSION') && ENV['DBVERSION']
dumpfile = "dump.v#{ENV['DBVERSION']}.sql"
end

log "using dumpfile: #{dumpfile}"

if File.exists?("#{node['vagrant']['directory']}/#{dumpfile}")
execute "create-tables" do
command "mysql -u root -p#{node['mysql']['server_root_password']} #{node['mysql']['database']} < #{node['vagrant']['directory']}/#{dumpfile}"
end
end


# configure apache
execute "disable-default-site" do
command "sudo a2dissite default"
notifies :reload, resources(:service => "apache2"), :delayed
Expand Down

0 comments on commit db290b0

Please sign in to comment.