From a4022c2d7584cfcae33045904d05d9e6fc233968 Mon Sep 17 00:00:00 2001 From: aescling Date: Mon, 20 Mar 2023 23:51:49 -0400 Subject: [PATCH] Enhance asset precompilation to prebuild app icons This removes a requirement to add a line to our build scripts --- .gitlab-ci.yml | 1 - lib/tasks/assets.rake | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 56cf82aef..7a20909a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,7 +101,6 @@ diff: build: stage: build script: - - ./bin/rails branding:generate_app_icons # ew - ./bin/rails assets:precompile artifacts: name: assets diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 5931aae61..dc1a5eb4a 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -19,7 +19,10 @@ namespace :assets do end if Rake::Task.task_defined?('assets:precompile') - Rake::Task['assets:precompile'].enhance do + # Rake::Task.enhance accepts prerequisites as an argument, and postrequisites + # as a block; this will cause 'branding:generate_app_icons' to run *before* + # 'assets:precompile', and the code in the block to run *after* + Rake::Task['assets:precompile'].enhance ['branding:generate_app_icons'] do Webpacker.manifest.refresh Rake::Task['assets:generate_static_pages'].invoke end -- 2.47.3