mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 04:06:21 +00:00
23 lines
634 B
Ruby
23 lines
634 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class DeployFullRsync < DeployRsync
|
||
|
DEPENDENCIES = %i[
|
||
|
deploy_alternative_domain
|
||
|
deploy_hidden_service
|
||
|
deploy_local
|
||
|
deploy_www
|
||
|
]
|
||
|
|
||
|
# Sincroniza las ubicaciones alternativas también
|
||
|
#
|
||
|
# @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?
|
||
|
end
|
||
|
end
|