diff --git a/app/jobs/deploy_job.rb b/app/jobs/deploy_job.rb index 608b485..85411cb 100644 --- a/app/jobs/deploy_job.rb +++ b/app/jobs/deploy_job.rb @@ -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 diff --git a/app/models/deploy_local.rb b/app/models/deploy_local.rb index 9f143bd..b9de4a4 100644 --- a/app/models/deploy_local.rb +++ b/app/models/deploy_local.rb @@ -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?