5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 17:36: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
require 'open3'
# Este modelo implementa los distintos tipos de alojamiento que provee
# Sutty.
#
@ -11,11 +12,9 @@ class Deploy < ApplicationRecord
belongs_to :site
has_many :build_stats, dependent: :destroy
def deploy(**)
raise NotImplementedError
end
DEPENDENCIES = []
def url
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(output: false)
ssh? && rsync(output: output)
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.
#