17528: Fix assets:precompile @ build time, skip at install time.
authorTom Clegg <tom@curii.com>
Thu, 15 Apr 2021 20:02:11 +0000 (16:02 -0400)
committerTom Clegg <tom@curii.com>
Thu, 15 Apr 2021 20:02:11 +0000 (16:02 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

apps/workbench/config/arvados_config.rb
build/rails-package-scripts/postinst.sh
build/run-build-packages.sh
services/api/config/arvados_config.rb

index fb99b3117ae3c7f8995a904fbc9b38799d11a7f8..c5cc544b9b8717fc70b51c52c1c4b35ce03a16aa 100644 (file)
@@ -32,8 +32,8 @@ $arvados_config_defaults = clusterConfig
 $arvados_config_defaults["ClusterID"] = clusterID
 
 if ENV["ARVADOS_CONFIG"] == "none"
-  # Don't load config. This magic value is set by postinst so it can
-  # run "rake assets:precompile" without a real config.
+  # Don't load config. This magic value is set by packaging scripts so
+  # they can run "rake assets:precompile" without a real config.
   $arvados_config_global = $arvados_config_defaults.deep_dup
 else
   # Load the global config file
index 6b069957a46eca96982ddbff4026759869728015..766481116b93229067f1feed46407b669c5ac7d8 100644 (file)
@@ -226,12 +226,6 @@ configure_version() {
       prepare_database
   fi
 
-  # Here, "ARVADOS_CONFIG=none" tells arvados_config.rb not to try
-  # loading config from /etc: it might not exist on a new install, and
-  # assets:precompile doesn't depend on config anyway.
-  run_and_report "Precompiling assets" \
-                 ARVADOS_CONFIG=none $COMMAND_PREFIX bundle exec rake assets:precompile -q -s 2>/dev/null || true
-
   if [ -e /etc/arvados/config.yml ]; then
       # warn about config errors (deprecated/removed keys from
       # previous version, etc)
index f9db56a5ff56d69ed5e3095b386eaaf6883ac5a4..e231a83df8d22e291a7d048bc8fa3d00c136a109 100755 (executable)
@@ -401,8 +401,8 @@ if [[ "$?" == "0" ]] ; then
       mv /tmp/x /etc/arvados/config.yml
       perl -p -i -e 'BEGIN{undef $/;} s/WebDAV(.*?):\n( *)ExternalURL: ""/WebDAV$1:\n$2ExternalURL: "example.com"/g' /etc/arvados/config.yml
 
-      RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake npm:install >"$STDOUT_IF_DEBUG"
-      RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile >"$STDOUT_IF_DEBUG"
+      ARVADOS_CONFIG=none RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake npm:install >"$STDOUT_IF_DEBUG"
+      ARVADOS_CONFIG=none RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile >"$STDOUT_IF_DEBUG"
 
       # Remove generated configuration files so they don't go in the package.
       rm -rf /etc/arvados/
index eb48e271b9f327ec7daf4c9f5fb4cc96767da79f..2c259919aeb69e6852076485c30e71ca0dd6f293 100644 (file)
@@ -57,8 +57,8 @@ $arvados_config_defaults = clusterConfig
 $arvados_config_defaults["ClusterID"] = clusterID
 
 if ENV["ARVADOS_CONFIG"] == "none"
-  # Don't load config. This magic value is set by postinst so it can
-  # run "rake assets:precompile" without a real config.
+  # Don't load config. This magic value is set by packaging scripts so
+  # they can run "rake assets:precompile" without a real config.
   $arvados_config_global = $arvados_config_defaults.deep_dup
 else
   # Load the global config file