From 50f18a0ac66f07f302a9749092c490710f5635c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Sun, 19 Oct 2025 17:19:34 +0000 Subject: [PATCH] Add capistrano task to rebuild contributions --- Capfile | 3 +++ lib/capistrano/tasks/contributions.rake | 12 ++++++++++++ lib/tasks/contributions.rake | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 lib/capistrano/tasks/contributions.rake create mode 100644 lib/tasks/contributions.rake diff --git a/Capfile b/Capfile index 9ba9264f..093d34ac 100644 --- a/Capfile +++ b/Capfile @@ -9,3 +9,6 @@ require 'capistrano/rails' require 'capistrano/puma' install_plugin Capistrano::Puma install_plugin Capistrano::Puma::Systemd + +# Load custom tasks from `lib/capistrano/tasks` if you have any defined +Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } diff --git a/lib/capistrano/tasks/contributions.rake b/lib/capistrano/tasks/contributions.rake new file mode 100644 index 00000000..ad399382 --- /dev/null +++ b/lib/capistrano/tasks/contributions.rake @@ -0,0 +1,12 @@ +namespace :contributions do + desc 'Sync the contributions from scratch' + task :rebuild do + on roles(:app) do + within current_path do + with rails_env: fetch(:rails_env) do + execute :rake, 'contributions:rebuild' + end + end + end + end +end diff --git a/lib/tasks/contributions.rake b/lib/tasks/contributions.rake new file mode 100644 index 00000000..80a00aa3 --- /dev/null +++ b/lib/tasks/contributions.rake @@ -0,0 +1,6 @@ +namespace :contributions do + desc 'Sync the contributions from scratch' + task rebuild: :environment do + Repo.sync(rebuild_all: true) + end +end