1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

(feature) is the ES_JAVA_OPTS var exists, append to it instead of adding a new one

This commit is contained in:
Sylvain 2022-03-21 11:40:08 +01:00
parent cf40df058e
commit 0b074baef5

View File

@ -15,7 +15,13 @@ config() {
}
add_var() {
yq eval ".services.$SERVICE.environment += \"ES_JAVA_OPTS=-Dlog4j2.formatMsgNoLookups=true\"" docker-compose.yml
HAS_OPTS="$(yq eval ".services.$SERVICE.environment | .[] | select(. == \"ES_JAVA_OPTS*\")" docker-compose.yml)"
if [ -z "$HAS_OPTS" ]; then
yq -i eval ".services.$SERVICE.environment += \"ES_JAVA_OPTS=-Dlog4j2.formatMsgNoLookups=true\"" docker-compose.yml
else
yq -i eval "(.services.$SERVICE.environment | .[] | select(. == \"ES_JAVA_OPTS*\")) += \" -Dlog4j2.formatMsgNoLookups=true\"" docker-compose.yml
fi
}
proceed()