avisar cuando falla la compilación

This commit is contained in:
f 2020-01-24 12:12:49 -03:00
parent 8add50d310
commit 624ed476ca
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 15 additions and 2 deletions

View file

@ -15,6 +15,9 @@ class DeployJob < ApplicationJob
# No es opcional
unless @deployed[:deploy_local]
@site.update_attribute :status, 'waiting'
notify_usuaries
# Hacer fallar la tarea
raise DeployException, deploy_local.build_stats.last.log
end

View file

@ -13,7 +13,12 @@ class DeployLocal < Deploy
# Pasamos variables de entorno mínimas para no filtrar secretos de
# Sutty
def deploy
mkdir && yarn && bundle && jekyll_build
return false unless mkdir
return false unless yarn
return false unless gem
return false unless bundle
jekyll_build
end
# Sólo permitimos un deploy local
@ -49,7 +54,8 @@ class DeployLocal < Deploy
{
'HOME' => home_dir,
'PATH' => paths.join(':'),
'JEKYLL_ENV' => Rails.env
'JEKYLL_ENV' => Rails.env,
'LANG' => ENV['LANG']
}
end
@ -61,6 +67,10 @@ class DeployLocal < Deploy
File.exist? yarn_lock
end
def gem
run %(gem install bundler --no-document)
end
# Corre yarn dentro del repositorio
def yarn
return unless yarn_lock?