5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2025-02-23 04:31:49 +00:00

fix: rsync

This commit is contained in:
f 2024-12-23 17:28:44 -03:00
parent 93011f7172
commit da98a912dc
No known key found for this signature in database

View file

@ -10,6 +10,8 @@ class DeployRsync < Deploy
DEPENDENCIES = %i[deploy_local deploy_zip]
def deploy(output: false)
raise(ArgumentError, 'destination no está configurado') if destination.blank?
ssh? && rsync(output: output)
end
@ -20,13 +22,6 @@ class DeployRsync < Deploy
deploy_local.size
end
# Devolver el destino o lanzar un error si no está configurado
def destination
values[:destination].tap do |d|
raise(ArgumentError, 'destination no está configurado') if d.blank?
end
end
# @return [String]
def url
"https://#{hostname}/"
@ -45,9 +40,9 @@ class DeployRsync < Deploy
ssh_available = false
Net::SSH.start(host, user, verify_host_key: tofu, timeout: 5) do |ssh|
if values[:host_keys].blank?
if self.host_keys.blank?
# Guardar las llaves que se encontraron en la primera conexión
values[:host_keys] = ssh.transport.host_keys.map do |host_key|
self.host_keys = ssh.transport.host_keys.map do |host_key|
"#{host_key.ssh_type} #{host_key.fingerprint}"
end
@ -76,7 +71,7 @@ class DeployRsync < Deploy
#
# @return [Symbol]
def tofu
values[:host_keys].present? ? :always : :accept_new
self.host_keys.present? ? :always : :accept_new
end
# Devuelve el par user host