mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 16:31:41 +00:00
implementar la misma api en todos los deploys
This commit is contained in:
parent
f3c3da81e0
commit
1071eba200
7 changed files with 19 additions and 7 deletions
|
@ -11,7 +11,7 @@ class Deploy < ApplicationRecord
|
||||||
belongs_to :site
|
belongs_to :site
|
||||||
has_many :build_stats, dependent: :destroy
|
has_many :build_stats, dependent: :destroy
|
||||||
|
|
||||||
def deploy
|
def deploy(**)
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class DeployAlternativeDomain < Deploy
|
||||||
store :values, accessors: %i[hostname], coder: JSON
|
store :values, accessors: %i[hostname], coder: JSON
|
||||||
|
|
||||||
# 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) ||
|
||||||
File.symlink(site.hostname, destination).zero?
|
File.symlink(site.hostname, destination).zero?
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Genera una versión onion
|
# Genera una versión onion
|
||||||
class DeployHiddenService < DeployWww
|
class DeployHiddenService < DeployWww
|
||||||
def deploy
|
def deploy(**)
|
||||||
return true if fqdn.blank?
|
return true if fqdn.blank?
|
||||||
|
|
||||||
super
|
super
|
||||||
|
|
12
app/models/deploy_localized_domain.rb
Normal file
12
app/models/deploy_localized_domain.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# Soportar dominios localizados
|
||||||
|
class DeployLocalizedDomain < DeployAlternativeDomain
|
||||||
|
store :values, accessors: %i[hostname locale], coder: JSON
|
||||||
|
|
||||||
|
# Generar un link simbólico del sitio principal al alternativo
|
||||||
|
def deploy(**)
|
||||||
|
File.symlink?(destination) ||
|
||||||
|
File.symlink(File.join(site.hostname, locale), destination).zero?
|
||||||
|
end
|
||||||
|
end
|
|
@ -7,8 +7,8 @@
|
||||||
# jekyll-private-data
|
# jekyll-private-data
|
||||||
class DeployPrivate < DeployLocal
|
class DeployPrivate < DeployLocal
|
||||||
# No es necesario volver a instalar dependencias
|
# No es necesario volver a instalar dependencias
|
||||||
def deploy
|
def deploy(output: false)
|
||||||
jekyll_build
|
jekyll_build(output: output)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Hacer el deploy a un directorio privado
|
# Hacer el deploy a un directorio privado
|
||||||
|
|
|
@ -6,7 +6,7 @@ class DeployWww < Deploy
|
||||||
|
|
||||||
before_destroy :remove_destination!
|
before_destroy :remove_destination!
|
||||||
|
|
||||||
def deploy
|
def deploy(**)
|
||||||
File.symlink?(destination) ||
|
File.symlink?(destination) ||
|
||||||
File.symlink(site.hostname, destination).zero?
|
File.symlink(site.hostname, destination).zero?
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@ class DeployZip < Deploy
|
||||||
# y generar un zip accesible públicamente.
|
# y generar un zip accesible públicamente.
|
||||||
#
|
#
|
||||||
# rubocop:disable Metrics/MethodLength
|
# rubocop:disable Metrics/MethodLength
|
||||||
def deploy
|
def deploy(**)
|
||||||
FileUtils.rm_f path
|
FileUtils.rm_f path
|
||||||
|
|
||||||
time_start
|
time_start
|
||||||
|
|
Loading…
Reference in a new issue