mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-21 11:01:47 +00:00
Merge branch 'issue-2466' into 'rails'
Issue #2466 See merge request sutty/sutty!120
This commit is contained in:
commit
cb17c651bc
2 changed files with 8 additions and 3 deletions
|
@ -68,9 +68,7 @@ class SitesController < ApplicationController
|
||||||
def enqueue
|
def enqueue
|
||||||
authorize site
|
authorize site
|
||||||
|
|
||||||
# XXX: Convertir en una máquina de estados?
|
SiteService.new(site: site).deploy
|
||||||
site.enqueue!
|
|
||||||
DeployJob.perform_async site.id
|
|
||||||
|
|
||||||
redirect_to site_posts_path(site, locale: site.default_locale)
|
redirect_to site_posts_path(site, locale: site.default_locale)
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
# Se encargar de guardar cambios en sitios
|
# Se encargar de guardar cambios en sitios
|
||||||
# TODO: Implementar rollback en la configuración
|
# TODO: Implementar rollback en la configuración
|
||||||
SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
|
SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
|
||||||
|
def deploy
|
||||||
|
site.enqueue!
|
||||||
|
DeployJob.perform_async site.id
|
||||||
|
end
|
||||||
|
|
||||||
# Crea un sitio, agrega un rol nuevo y guarda los cambios a la
|
# Crea un sitio, agrega un rol nuevo y guarda los cambios a la
|
||||||
# configuración en el repositorio git
|
# configuración en el repositorio git
|
||||||
def create
|
def create
|
||||||
|
@ -26,6 +31,8 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
|
||||||
|
|
||||||
add_licencias
|
add_licencias
|
||||||
|
|
||||||
|
deploy
|
||||||
|
|
||||||
site
|
site
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue