Skip to content

Commit b62858b

Browse files
committed
Merge pull request #71 from shishi/add_cap3_support
Add Capistrano3 support
2 parents a0ccc59 + a47f53c commit b62858b

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ require 'seed-fu/capistrano'
149149
after 'deploy:update_code', 'db:seed_fu'
150150
```
151151

152+
If you use Capistrano3, you should require another file.
153+
154+
```ruby
155+
require 'seed-fu/capistrano3'
156+
157+
# Trigger the task before publishing
158+
before 'deploy:publishing', 'db:seed_fu'
159+
```
160+
152161
Bugs / Feature requests
153162
-----------------------
154163

lib/seed-fu/capistrano3.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
load File.expand_path('../../tasks/seed_fu_capistrano3.rake', __FILE__)

lib/tasks/seed_fu_capistrano3.rake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace :db do
2+
desc 'Load seed data into database'
3+
task :seed_fu do
4+
on roles(:db) do
5+
within release_path do
6+
with rails_env: fetch(:rails_env) do
7+
execute :bundle, :exec, :rake, 'db:seed_fu'
8+
end
9+
end
10+
end
11+
end
12+
end

0 commit comments

Comments
 (0)