5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-20 07:16:21 +00:00

Merge branch 'issue-10464' into panel.sutty.nl
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
f 2023-03-24 14:24:54 -03:00
commit d3cf802a7b

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class DeployFullRsync < DeployRsync
DEPENDENCIES = %i[
SOFT_DEPENDENCIES = %i[
deploy_alternative_domain
deploy_hidden_service
deploy_local
@ -9,16 +9,24 @@ class DeployFullRsync < DeployRsync
deploy_zip
]
# Sincroniza las ubicaciones alternativas también
# Sincroniza las ubicaciones alternativas también, ignorando las que
# todavía no se generaron. Solo falla si ningún sitio fue
# sincronizado o si alguna sincronización falló.
#
# @param :output [Boolean]
# @return [Boolean]
def rsync(output: false)
DEPENDENCIES.map(&:to_s).map(&:classify).map do |dependency|
site.deploys.where(type: dependency).find_each.map do |deploy|
run %(rsync -aviH --delete-after --timeout=5 #{Shellwords.escape deploy.destination} #{Shellwords.escape destination}), output: output
end
end.flatten.all?
result =
SOFT_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
run %(rsync -aviH --delete-after --timeout=5 #{Shellwords.escape deploy.destination} #{Shellwords.escape destination}), output: output
rescue StandardError
end
end.flatten.compact
result.present? && result.all?
end
def url