5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 16:46:22 +00:00

poder ver la salida si lo ejecutamos desde la terminal

This commit is contained in:
f 2022-03-15 16:03:16 -03:00
parent 878311abf6
commit b9b11b20b8
2 changed files with 15 additions and 13 deletions

View file

@ -6,7 +6,9 @@ class DeployJob < ApplicationJob
class DeployTimedOutException < DeployException; end class DeployTimedOutException < DeployException; end
# rubocop:disable Metrics/MethodLength # rubocop:disable Metrics/MethodLength
def perform(site, notify = true, time = Time.now) def perform(site, notify: true, time: Time.now, output: false)
@output = output
ActiveRecord::Base.connection_pool.with_connection do ActiveRecord::Base.connection_pool.with_connection do
@site = Site.find(site) @site = Site.find(site)
@ -22,7 +24,7 @@ class DeployJob < ApplicationJob
"#{@site.name} la tarea estuvo más de 10 minutos esperando, volviendo al estado original" "#{@site.name} la tarea estuvo más de 10 minutos esperando, volviendo al estado original"
end end
DeployJob.perform_in(60, site, notify, time) DeployJob.perform_in(60, site, notify: notify, time: time, output: output)
return return
end end

View file

@ -12,12 +12,12 @@ class DeployLocal < Deploy
# #
# Pasamos variables de entorno mínimas para no filtrar secretos de # Pasamos variables de entorno mínimas para no filtrar secretos de
# Sutty # Sutty
def deploy def deploy(output: false)
return false unless mkdir return false unless mkdir
return false unless yarn return false unless yarn(output: output)
return false unless bundle return false unless bundle(output: output)
jekyll_build jekyll_build(output: output)
end end
# Sólo permitimos un deploy local # Sólo permitimos un deploy local
@ -85,23 +85,23 @@ class DeployLocal < Deploy
File.exist? yarn_lock File.exist? yarn_lock
end end
def gem def gem(output: false)
run %(gem install bundler --no-document) run %(gem install bundler --no-document), output: output
end end
# Corre yarn dentro del repositorio # Corre yarn dentro del repositorio
def yarn def yarn(output: false)
return true unless yarn_lock? return true unless yarn_lock?
run 'yarn install --production' run 'yarn install --production', output: output
end end
def bundle def bundle
run %(bundle install --no-cache --path="#{gems_dir}") run %(bundle install --no-cache --path="#{gems_dir}"), output: output
end end
def jekyll_build def jekyll_build(output: false)
run %(bundle exec jekyll build --trace --profile --destination "#{escaped_destination}") run %(bundle exec jekyll build --trace --profile --destination "#{escaped_destination}"), output: output
end end
# no debería haber espacios ni caracteres especiales, pero por si # no debería haber espacios ni caracteres especiales, pero por si