Skip to content

Commit 50f18a0

Browse files
committed
Add capistrano task to rebuild contributions
1 parent 5868f12 commit 50f18a0

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

Capfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ require 'capistrano/rails'
99
require 'capistrano/puma'
1010
install_plugin Capistrano::Puma
1111
install_plugin Capistrano::Puma::Systemd
12+
13+
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
14+
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace :contributions do
2+
desc 'Sync the contributions from scratch'
3+
task :rebuild do
4+
on roles(:app) do
5+
within current_path do
6+
with rails_env: fetch(:rails_env) do
7+
execute :rake, 'contributions:rebuild'
8+
end
9+
end
10+
end
11+
end
12+
end

lib/tasks/contributions.rake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace :contributions do
2+
desc 'Sync the contributions from scratch'
3+
task rebuild: :environment do
4+
Repo.sync(rebuild_all: true)
5+
end
6+
end

0 commit comments

Comments
 (0)