From 27004c7c4cffac0b61c3fb346e0bd9b155c3763c Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 15 Apr 2021 16:02:11 -0400 Subject: [PATCH] 17528: Fix assets:precompile @ build time, skip at install time. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- apps/workbench/config/arvados_config.rb | 4 ++-- build/rails-package-scripts/postinst.sh | 6 ------ build/run-build-packages.sh | 4 ++-- services/api/config/arvados_config.rb | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/apps/workbench/config/arvados_config.rb b/apps/workbench/config/arvados_config.rb index fb99b3117a..c5cc544b9b 100644 --- a/apps/workbench/config/arvados_config.rb +++ b/apps/workbench/config/arvados_config.rb @@ -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 diff --git a/build/rails-package-scripts/postinst.sh b/build/rails-package-scripts/postinst.sh index 6b069957a4..766481116b 100644 --- a/build/rails-package-scripts/postinst.sh +++ b/build/rails-package-scripts/postinst.sh @@ -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) diff --git a/build/run-build-packages.sh b/build/run-build-packages.sh index f9db56a5ff..e231a83df8 100755 --- a/build/run-build-packages.sh +++ b/build/run-build-packages.sh @@ -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/ diff --git a/services/api/config/arvados_config.rb b/services/api/config/arvados_config.rb index eb48e271b9..2c259919ae 100644 --- a/services/api/config/arvados_config.rb +++ b/services/api/config/arvados_config.rb @@ -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 -- 2.30.2