From 62857d2779a62967feaa307ea50f87218d8a82f8 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Sun, 13 May 2018 19:56:48 +0200 Subject: Add ci:fix_webpacker task to prevent yarn launch. Refs #6996. Refs #5802 --- lib/tasks/ci.rake | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index e31017b5a..7ef867b71 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -14,8 +14,14 @@ namespace :ci do desc "Prepare CI build" task :setup do - # FIXME remove this specific behavior + unless ENV["IGNORE_YARN_INSTALL"] + # FIXME remove this specific behavior + # Managed by Dockerfile.build + sh "yarn --frozen-lockfile install" + end + unless ENV["KEEP_DATABASE_CONFIG"] + # FIXME remove this specific behavior cp "config/database.yml", "config/database.yml.orig" cp "config/database/ci.yml", "config/database.yml" end @@ -28,6 +34,15 @@ namespace :ci do end end + task :fix_webpacker do + # Redefine webpacker:yarn_install to avoid --production + # in CI process + Rake::Task["webpacker:yarn_install"].clear + Rake::Task.define_task "webpacker:yarn_install" do + puts "Don't run yarn" + end + end + def git_branch if ENV['GIT_BRANCH'] =~ %r{/(.*)$} $1 @@ -55,7 +70,7 @@ namespace :ci do end task :assets do - sh "RAILS_ENV=test bundle exec rake assets:precompile i18n:js:export" + sh "RAILS_ENV=test bundle exec rake ci:fix_webpacker assets:precompile i18n:js:export" end task :jest do -- cgit v1.2.3