5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-17 10:16:22 +00:00

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

This commit is contained in:
f 2023-04-21 16:27:42 -03:00
commit 40cf4d9754
3 changed files with 24 additions and 1 deletions

View file

@ -38,6 +38,7 @@ class DeployRsync < Deploy
#
# @return [Boolean]
def ssh?
return true if destination.start_with? 'rsync://'
user, host = user_host
ssh_available = false

View file

@ -215,7 +215,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
# Crea los deploys necesarios para sincronizar a otros nodos de Sutty
def sync_nodes
Rails.application.nodes.each do |node|
site.deploys.build(type: 'DeployFullRsync', destination: "sutty@#{node}:")
site.deploys.build(type: 'DeployFullRsync', destination: "rsync://#{node}/deploys/")
end
end

View file

@ -0,0 +1,22 @@
# frozen_string_literal: true
# Envía los cambios a través de rsyncd
class ChangeFullRsyncDestination < ActiveRecord::Migration[6.1]
def up
DeployFullRsync.find_each do |deploy|
Rails.application.nodes.each do |node|
deploy.destination = "rsync://rsyncd.#{node}/deploys/"
deploy.save
end
end
end
def down
DeployFullRsync.find_each do |deploy|
Rails.application.nodes.each do |node|
deploy.destination = "sutty@#{node}:"
deploy.save
end
end
end
end