5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 22:16: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
require 'open3'
# Este modelo implementa los distintos tipos de alojamiento que provee
# Sutty.
#
@ -11,6 +12,8 @@ class Deploy < ApplicationRecord
belongs_to :site
has_many :build_stats, dependent: :destroy
DEPENDENCIES = []
def deploy
raise NotImplementedError
end

View file

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

View file

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

View file

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

View file

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