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
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
commit
40cf4d9754
3 changed files with 24 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
22
db/migrate/20230421182627_change_full_rsync_destination.rb
Normal file
22
db/migrate/20230421182627_change_full_rsync_destination.rb
Normal 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
|
Loading…
Reference in a new issue