From a6522b28bd1303d5b09e43a7505d0447411e30db Mon Sep 17 00:00:00 2001 From: Simon Williams Date: Tue, 15 Nov 2016 16:49:20 -0700 Subject: [PATCH] rake: extract `rake js:gulp_rev` as a distinct task Change-Id: I0c4b687eb74937a908221155c7565c9fd5a79b99 Reviewed-on: https://gerrit.instructure.com/95331 Tested-by: Jenkins Reviewed-by: Ryan Shaw Product-Review: Ryan Shaw QA-Review: Ryan Shaw --- lib/tasks/canvas.rake | 3 ++- lib/tasks/js.rake | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/tasks/canvas.rake b/lib/tasks/canvas.rake index e70ffacdc23..220fa145ac9 100644 --- a/lib/tasks/canvas.rake +++ b/lib/tasks/canvas.rake @@ -95,7 +95,8 @@ namespace :canvas do end combined_time = times.reduce(:+) puts "Finished compiling assets in #{real_time}. parallelism saved #{combined_time - real_time} (#{real_time.to_f / combined_time.to_f * 100.0}%)" - raise "Error reving files" unless system('node_modules/.bin/gulp rev') + + log_time("gulp rev") { Rake::Task['js:gulp_rev'].invoke } end end diff --git a/lib/tasks/js.rake b/lib/tasks/js.rake index bcd1ce94640..5977bc1ab15 100644 --- a/lib/tasks/js.rake +++ b/lib/tasks/js.rake @@ -230,4 +230,9 @@ namespace :js do puts "node is: #{`node -v`.strip} (#{`which node`.strip})" raise 'error running npm install' unless `npm install` end + + desc "Run Gulp Rev, for fingerprinting assets" + task :gulp_rev do + raise "Error reving files" unless system('node_modules/.bin/gulp rev') + end end