From 6fb2ab0d30f5a3b140f6cb31afa94f28c14ba50c Mon Sep 17 00:00:00 2001 From: antuarc Date: Fri, 10 May 2024 13:46:49 +1000 Subject: [PATCH] [QOLDEV-833] ensure plugins are installed in a viable order - Archiver needs to come after Report. QA needs to come after both. Geoscience Harvester needs to come after Harvester. - Just push all the plugins that depend on others to the end of the list. --- recipes/ckanweb-deploy-exts.rb | 16 ++++++++++++++++ resources/pip_install_app.rb | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/recipes/ckanweb-deploy-exts.rb b/recipes/ckanweb-deploy-exts.rb index 45da06d..a60c0c6 100755 --- a/recipes/ckanweb-deploy-exts.rb +++ b/recipes/ckanweb-deploy-exts.rb @@ -129,7 +129,23 @@ harvest_present = false csrf_present = false +# Ensure plugins that depend on others are installed last +dependent_plugins = ['CKANExtArchiver', 'CKANExtQa', 'CKANExtHarvestDataQldGeoScience'] +sorted_plugin_names = [] +dependent_plugin_names = [] node['datashades']['ckan_web']['plugin_app_names'].each do |plugin| + if dependent_plugins.include? plugin then + dependent_plugin_names.append(plugin) + else + sorted_plugin_names.append(plugin) + end +end + +# Ensure Archiver comes before QA +dependent_plugin_names.sort! + +sorted_plugin_names.concat(dependent_plugin_names) +sorted_plugin_names.each do |plugin| egg_name = `aws ssm get-parameter --region "#{node['datashades']['region']}" --name "/config/CKAN/#{node['datashades']['version']}/app/#{node['datashades']['app_id']}/plugin_apps/#{plugin}/shortname" --query "Parameter.Value" --output text`.strip diff --git a/resources/pip_install_app.rb b/resources/pip_install_app.rb index caf25cb..36811af 100644 --- a/resources/pip_install_app.rb +++ b/resources/pip_install_app.rb @@ -131,7 +131,7 @@ if [ -f "pip-requirements.txt" ]; then REQUIREMENTS_FILES="$REQUIREMENTS_FILES -r pip-requirements.txt" fi - #{pip} install -e . $REQUIREMENTS_FILES + #{pip} install -e . $REQUIREMENTS_FILES || exit 1 fi EOS end