Skip to content

Instantly share code, notes, and snippets.

@garin
Created June 3, 2015 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garin/f93aa66f465faaf35767 to your computer and use it in GitHub Desktop.
Save garin/f93aa66f465faaf35767 to your computer and use it in GitHub Desktop.
lib/capistrano/tasks/fixturesload.rake
# require capistrano/rails
# https://github.com/capistrano/rails
#
# fixtures:load
namespace :deploy do
desc 'Runs rake db:fixtures:load (original)'
task :fixtures => [:set_rails_env] do
on primary fetch(:fixtures_role) do
info '[deploy:migrate] Run `rake db:fixtures:load`'
within release_path do
with rails_env: fetch(:rails_env) do
execute :rake, "db:fixtures:load"
end
end
end
end
after 'deploy:updated', 'deploy:migrate'
end
namespace :load do
task :defaults do
set :fixtures_role, fetch(:fixtures_role, :db)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment