Browse Source

fix: [minecraft] reload when any configuration changes

odoo_fix_webhook_url
Valentin Lab 11 months ago
parent
commit
016299e189
  1. 3
      minecraft/hooks/init
  2. 11
      minecraft/lib/common

3
minecraft/hooks/init

@ -40,3 +40,6 @@ ops=$(options-get ops) || true
minecraft:make-ops "$ops"
minecraft:make-properties "$properties"
service_def=$(get_compose_service_def "$SERVICE_NAME") || exit 1
minecraft:config-hash "$service_def"

11
minecraft/lib/common

@ -74,3 +74,14 @@ minecraft:make-properties() {
} > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/server.properties"
}
minecraft:config-hash() {
local opts="$1"
debug "Adding config hash to enable recreating upon config change."
config_hash=$(e "$opts" | md5_compat) || exit 1
init-config-add "
$SERVICE_NAME:
labels:
- compose.config_hash=$config_hash
"
}
Loading…
Cancel
Save