Marko Oldenburg b2d45ee0c4
Some checks failed
Build Helm Chart / helm-package (push) Failing after 30s
```
Rename artemis-broker to artemis-broker-primary

This commit renames and refactors the Helm chart for the
artemis-broker. The original files in the artemis-broker
directory are renamed and moved to artemis-broker-primary.
The purpose of this change is to enable a clear
distinction between the primary broker configuration and any
backup or alternative configurations.

Additionally, the configuration has been updated to support
enhancements in TLS setup, metrics services, and users,
allowing for a more robust and flexible deployment.
This change introduces new templates and scripts needed
for managing various aspects of the broker's functions,
including improved user authentication and logging. No
breaking changes were introduced, but users must update
their references to the chart paths as they now point to
the new directory structure.
```
2025-03-18 08:30:01 +01:00

38 lines
880 B
Bash
Executable File

#!/bin/bash
set -e
INSTANCE_DIR=$1
declare -a CONFIG_FILES=("bootstrap.xml" "broker.xml" "logging.properties")
function swapVars() {
# Requires bash v4+
declare -A SUBSTITUTIONS
while read -r SUBVAR
do
SUBSTITUTIONS[$SUBVAR]=1
done < <( awk '{
while( match($0, /\$\{[a-zA-Z_0-9][a-zA-Z_0-9]*\}/) ) {
print substr($0, RSTART, RLENGTH)
sub(/\$\{[a-zA-Z_0-9][a-zA-Z_0-9]*\}/, "matched", $0)
}
}' $1 )
echo "Found placeholder variables: \"${!SUBSTITUTIONS[@]}\". Customizing configuration.."
for var in "${!SUBSTITUTIONS[@]}"; do
sed -i "s#$var#$(eval echo \"$var\")#g" $1
done
}
for config_file in ${CONFIG_FILES[@]};
do
# Swap env vars into configuration file
if [[ -e $INSTANCE_DIR/etc/$config_file ]]; then
echo "Patching Custom Configuration file '$config_file'"
swapVars $INSTANCE_DIR/etc/$config_file
fi
done