From aa0c359554917ef93547d3446e55ac73394587a8 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 6 Apr 2022 19:06:11 -0300 Subject: [PATCH] crear un rsync por cada sitio existente --- .../20220406211042_add_deploy_rsync_to_sites.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 db/migrate/20220406211042_add_deploy_rsync_to_sites.rb diff --git a/db/migrate/20220406211042_add_deploy_rsync_to_sites.rb b/db/migrate/20220406211042_add_deploy_rsync_to_sites.rb new file mode 100644 index 00000000..92b6f17b --- /dev/null +++ b/db/migrate/20220406211042_add_deploy_rsync_to_sites.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# Agrega un DeployRsync hacia los servidores alternativos para cada +# sitio +class AddDeployRsyncToSites < ActiveRecord::Migration[6.1] + def up + Site.find_each do |site| + SiteService.new(site: site).send :sync_nodes + site.save + end + end + + def down + DeployRsync.destroy_all + end +end