From 373cdf895a68a976ac628ce50773cf3fa0fb4966 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 27 Mar 2023 14:43:01 -0300 Subject: [PATCH 1/3] feat: sincronizar dominios por idioma --- app/models/deploy_full_rsync.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/deploy_full_rsync.rb b/app/models/deploy_full_rsync.rb index a3c1840d..7bc0e788 100644 --- a/app/models/deploy_full_rsync.rb +++ b/app/models/deploy_full_rsync.rb @@ -3,6 +3,7 @@ class DeployFullRsync < DeployRsync SOFT_DEPENDENCIES = %i[ deploy_alternative_domain + deploy_localized_domain deploy_hidden_service deploy_local deploy_www From 68704dd5984a479aa4e7cab0030ee61c274cc207 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 27 Mar 2023 14:44:22 -0300 Subject: [PATCH 2/3] fix: deprecar DeployLocal#extra_env --- app/models/deploy.rb | 1 + app/models/deploy_local.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/deploy.rb b/app/models/deploy.rb index 52031d87..33dc9f2b 100644 --- a/app/models/deploy.rb +++ b/app/models/deploy.rb @@ -13,6 +13,7 @@ class Deploy < ApplicationRecord has_many :build_stats, dependent: :destroy DEPENDENCIES = [] + SOFT_DEPENDENCIES = [] def deploy(**) raise NotImplementedError diff --git a/app/models/deploy_local.rb b/app/models/deploy_local.rb index 9c0ba492..c031c7b9 100644 --- a/app/models/deploy_local.rb +++ b/app/models/deploy_local.rb @@ -152,6 +152,7 @@ class DeployLocal < Deploy # Consigue todas las variables de entorno configuradas por otros # deploys. # + # @deprecated Solo tenía sentido para Distributed Press v0 # @return [Hash] def extra_env @extra_env ||= From 5e23a7568060ca42f4c9f6599f0cd2eb303cd918 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 27 Mar 2023 14:52:37 -0300 Subject: [PATCH 3/3] feat: tener en cuenta las dependencias suaves al armar el grafo --- app/models/deploy.rb | 7 +++++++ app/models/deploy_full_rsync.rb | 4 +--- app/models/site/deploy_dependencies.rb | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/models/deploy.rb b/app/models/deploy.rb index 33dc9f2b..a92708c0 100644 --- a/app/models/deploy.rb +++ b/app/models/deploy.rb @@ -100,6 +100,13 @@ class Deploy < ApplicationRecord @local_env ||= {} end + # Trae todas las dependencias + # + # @return [Array] + def self.all_dependencies + self::DEPENDENCIES | self::SOFT_DEPENDENCIES + end + private # @param [String] diff --git a/app/models/deploy_full_rsync.rb b/app/models/deploy_full_rsync.rb index 7bc0e788..b8c48eab 100644 --- a/app/models/deploy_full_rsync.rb +++ b/app/models/deploy_full_rsync.rb @@ -5,9 +5,7 @@ class DeployFullRsync < DeployRsync deploy_alternative_domain deploy_localized_domain deploy_hidden_service - deploy_local deploy_www - deploy_zip ] # Sincroniza las ubicaciones alternativas también, ignorando las que @@ -18,7 +16,7 @@ class DeployFullRsync < DeployRsync # @return [Boolean] def rsync(output: false) result = - SOFT_DEPENDENCIES.map(&:to_s).map(&:classify).map do |dependency| + self.class.all_dependencies.map(&:to_s).map(&:classify).map do |dependency| site.deploys.where(type: dependency).find_each.map do |deploy| next unless File.exist? deploy.destination diff --git a/app/models/site/deploy_dependencies.rb b/app/models/site/deploy_dependencies.rb index a01f99e7..ed80a8af 100644 --- a/app/models/site/deploy_dependencies.rb +++ b/app/models/site/deploy_dependencies.rb @@ -18,7 +18,7 @@ class Site end deploys.each do |deploy| - deploy.class::DEPENDENCIES.each do |dependency| + deploy.class.all_dependencies.each do |dependency| deploys.where(type: dependency.to_s.classify).each do |deploy_dependency| graph.add_edge deploy_dependency, deploy end