refactor: ♻️ improve config setting script for readability

Refactor the configuration script to use an associative array for better readability and maintainability. This change streamlines how configuration values are set in the initialization script.
This commit is contained in:
Maicol Battistini 2024-09-30 19:45:50 +02:00
parent 71d215d613
commit d28306db66
No known key found for this signature in database
1 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,15 @@
#!/bin/bash
ckan config-tool ${APP_DIR}/production.ini "ckanext.spatial.common_map.type=Stadia.StamenTerrain" "ckanext.spatial.common_map.max_zoom=18" "ckanext.spatial.search_backend = solr-spatial-field" "ckan.search.solr_allowed_query_parsers = field" "ckan.harvest.mq.type=redis" "ckan.harvest.mq.hostname=redis" "googleanalytics.id=UA-1010101-1"
declare -A config_values=(
["ckanext.spatial.common_map.type"]="Stadia.StamenTerrain"
["ckanext.spatial.common_map.max_zoom"]="18"
["ckanext.spatial.search_backend"]="solr-spatial-field"
["ckan.search.solr_allowed_query_parsers"]="field"
["ckan.harvest.mq.type"]="redis"
["ckan.harvest.mq.hostname"]="redis"
["googleanalytics.id"]="UA-1010101-1"
)
for key in "${!config_values[@]}"; do
ckan config-tool "${CKAN_INI}" "${key}=${config_values[$key]}"
done