From 624ed476ca47bfa2c5b19cf4624028094d6945e7 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 24 Jan 2020 12:12:49 -0300 Subject: [PATCH] =?UTF-8?q?avisar=20cuando=20falla=20la=20compilaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/deploy_job.rb | 3 +++ app/models/deploy_local.rb | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/jobs/deploy_job.rb b/app/jobs/deploy_job.rb index 608b485b..85411cb0 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 9f143bd3..b9de4a44 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?