]> cat aescling's git repositories - mastodon.git/commitdiff
Enhance asset precompilation to prebuild app icons origin/no-search-engine-indexing
authoraescling <aescling+gitlab@cat.family>
Tue, 21 Mar 2023 03:51:49 +0000 (23:51 -0400)
committeraescling <aescling+gitlab@cat.family>
Tue, 21 Mar 2023 03:51:49 +0000 (23:51 -0400)
This removes a requirement to add a line to our build scripts

.gitlab-ci.yml
lib/tasks/assets.rake

index 56cf82aeff9a1f508bbf78332f27993ca29af5ee..7a20909a26d996ebf88ab18f3d54054b1eb8d5ba 100644 (file)
@@ -101,7 +101,6 @@ diff:
 build:
   stage: build
   script:
-    - ./bin/rails branding:generate_app_icons # ew
     - ./bin/rails assets:precompile
   artifacts:
     name: assets
index 5931aae61894239bb294319ccb62ad94b324c364..dc1a5eb4a246b77ff701794a93063129a1572001 100644 (file)
@@ -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