plugin RPMs do not build when they contain webpack assets
** Invoke plugin:assets:precompile (first_time) ** Invoke environment (first_time) ** Execute environment /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/logger.rb:295: warning: constant ::Fixnum is deprecated API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache. INFO app : Current user: foreman_admin (administrator) INFO app : Current user: foreman_admin (administrator) INFO app : Current user: foreman_admin (administrator) rake aborted! Errno::EACCES: Permission denied @ rb_sysopen - /builddir/build/BUILD/rubygem-katello-3.7.0/usr/share/foreman/public/webpack/manifest.json /builddir/build/BUILD/rubygem-katello-3.7.0/usr/share/foreman/config/initializers/assets.rb:109:in `initialize' /builddir/build/BUILD/rubygem-katello-3.7.0/usr/share/foreman/config/initializers/assets.rb:109:in `open' /builddir/build/BUILD/rubygem-katello-3.7.0/usr/share/foreman/config/initializers/assets.rb:109:in `block (2 levels) in <top (required)>' …
Fixes #23361 - Handle webpack manifests from plugins
In a production setup Foreman can't write to the manifest.json location.
Here we copy the pattern from the above sprockets initialization and
change the webpack-rails setting to read it. Because webpack-rails
only supports initializing the manifest by reading a file, we monkey
patch it to allow us setting it explicitly.