5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 00:06:21 +00:00

fix: generar todos los deploys automáticamente

This commit is contained in:
f 2023-08-30 10:47:27 -03:00
parent 9ac404ae06
commit f019805314
No known key found for this signature in database
2 changed files with 2 additions and 7 deletions

View file

@ -19,10 +19,6 @@ class Site < ApplicationRecord
# protege de acceso al panel de Sutty!
encrypts :private_key
# TODO: Hacer que los diferentes tipos de deploy se auto registren
# @see app/services/site_service.rb
DEPLOYS = %i[local private www zip hidden_service distributed_press].freeze
validates :name, uniqueness: true, hostname: {
allow_root_label: true
}

View file

@ -54,9 +54,8 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
# Genera los Deploy necesarios para el sitio a menos que ya los tenga.
def build_deploys
Site::DEPLOYS.map { |deploy| "Deploy#{deploy.to_s.camelcase}" }
.each do |deploy|
next if site.deploys.find_by type: deploy
Deploy.subclasses.each do |deploy|
next if site.deploys.find_by type: deploy.name
site.deploys.build type: deploy
end