5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-17 00:36:22 +00:00

Merge branch 'issue-2466' into 'rails'

Issue #2466

See merge request sutty/sutty!120
This commit is contained in:
fauno 2023-03-23 21:51:55 +00:00
commit cb17c651bc
2 changed files with 8 additions and 3 deletions

View file

@ -68,9 +68,7 @@ class SitesController < ApplicationController
def enqueue
authorize site
# XXX: Convertir en una máquina de estados?
site.enqueue!
DeployJob.perform_async site.id
SiteService.new(site: site).deploy
redirect_to site_posts_path(site, locale: site.default_locale)
end

View file

@ -3,6 +3,11 @@
# Se encargar de guardar cambios en sitios
# TODO: Implementar rollback en la configuración
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
# configuración en el repositorio git
def create
@ -26,6 +31,8 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
add_licencias
deploy
site
end