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

feat: los deploys son interdependientes

This commit is contained in:
f 2023-03-17 18:38:47 -03:00
parent b15ebdf549
commit 4f8ea0d9a7
5 changed files with 17 additions and 4 deletions

View file

@ -1,6 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'open3' require 'open3'
# Este modelo implementa los distintos tipos de alojamiento que provee # Este modelo implementa los distintos tipos de alojamiento que provee
# Sutty. # Sutty.
# #
@ -11,11 +12,9 @@ class Deploy < ApplicationRecord
belongs_to :site belongs_to :site
has_many :build_stats, dependent: :destroy has_many :build_stats, dependent: :destroy
def deploy(**) DEPENDENCIES = []
raise NotImplementedError
end
def url def deploy(**)
raise NotImplementedError raise NotImplementedError
end end

View file

@ -4,6 +4,8 @@
class DeployAlternativeDomain < Deploy class DeployAlternativeDomain < Deploy
store :values, accessors: %i[hostname], coder: JSON store :values, accessors: %i[hostname], coder: JSON
DEPENDENCIES = %i[local]
# Generar un link simbólico del sitio principal al alternativo # Generar un link simbólico del sitio principal al alternativo
def deploy(**) def deploy(**)
File.symlink?(destination) || File.symlink?(destination) ||

View file

@ -5,6 +5,14 @@
class DeployRsync < Deploy class DeployRsync < Deploy
store :values, accessors: %i[destination host_keys], coder: JSON store :values, accessors: %i[destination host_keys], coder: JSON
DEPENDENCIES = %i[
alternative_domain
hidden_service
local
www
zip
]
def deploy(output: false) def deploy(output: false)
ssh? && rsync(output: output) ssh? && rsync(output: output)
end end

View file

@ -4,6 +4,8 @@
class DeployWww < Deploy class DeployWww < Deploy
store :values, accessors: %i[], coder: JSON store :values, accessors: %i[], coder: JSON
DEPENDENCIES = %i[local]
before_destroy :remove_destination! before_destroy :remove_destination!
def deploy(**) def deploy(**)

View file

@ -8,6 +8,8 @@ require 'zip'
class DeployZip < Deploy class DeployZip < Deploy
store :values, accessors: %i[], coder: JSON store :values, accessors: %i[], coder: JSON
DEPENDENCIES = %i[local]
# Una vez que el sitio está generado, tomar todos los archivos y # Una vez que el sitio está generado, tomar todos los archivos y
# y generar un zip accesible públicamente. # y generar un zip accesible públicamente.
# #