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

feat: los deploys son interdependientes

This commit is contained in:
f 2023-03-17 18:38:47 -03:00
parent ca989fe8a7
commit 3230f71166
5 changed files with 17 additions and 0 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,6 +12,8 @@ class Deploy < ApplicationRecord
belongs_to :site belongs_to :site
has_many :build_stats, dependent: :destroy has_many :build_stats, dependent: :destroy
DEPENDENCIES = []
def deploy 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 def deploy
ssh? && rsync ssh? && rsync
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.
# #