5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 15:46:23 +00:00
panel/db/migrate/20230421182627_change_full_rsync_destination.rb

23 lines
532 B
Ruby
Raw Normal View History

# 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