@@ -1240,6 +1240,30 @@ __source_build() {
12401240}
12411241
12421242
1243+ # Remove after Glamsterdam
1244+ __migrate_alloy_obol () {
1245+ local prom_token
1246+
1247+ __get_compose_file
1248+ if [[ " ${__source_ver} " -lt 55 && " ${COMPOSE_FILE} " =~ lido-obol-alloy.yml ]]; then
1249+ var=" OBOL_PROM_REMOTE_WRITE_TOKEN"
1250+ __get_value_from_env " ${var} " " ${__env_file} " " __value"
1251+ if [[ -z " ${__value} " && -f ./prometheus/custom-prom.yml ]] && grep -q ' credentials:' ./prometheus/custom-prom.yml > /dev/null; then
1252+ echo " Migrating Lido Obol Promtail to Lido Obol Alloy"
1253+ prom_token=$( awk -F' : *' ' /credentials:/ {gsub(/"/,"",$2); print $2; exit}' ./prometheus/custom-prom.yml)
1254+ if [[ -z " ${prom_token} " ]]; then
1255+ echo " Could not determine value of OBOL_PROM_REMOTE_WRITE_TOKEN in ./prometheus/custom-prom.yml"
1256+ echo " Please update it yourself with \" nano .env\" "
1257+ return
1258+ fi
1259+ var=" OBOL_PROM_REMOTE_WRITE_TOKEN"
1260+ OBOL_PROM_REMOTE_WRITE_TOKEN=" ${prom_token} "
1261+ __update_value_in_env " ${var} " " ${! var} " " ${__env_file} "
1262+ fi
1263+ fi
1264+ }
1265+
1266+
12431267# When this gets called $var is CORE_FILES or CUSTOM_FILES and $__value is what is set in .env for it
12441268# This function rebuilds __value, applying any file name changes
12451269__migrate_compose_files () {
@@ -2268,6 +2292,8 @@ update() {
22682292 if [[ " ${__env_migrated} " -eq 1 ]] && ! cmp -s " ${__env_file} " " ${__env_file} " .source; then # Create .bak early
22692293 ${__as_owner} cp " ${__env_file} " .source " ${__env_file} " .bak
22702294 fi
2295+ # Remove after Glamsterdam
2296+ __migrate_alloy_obol
22712297 __pull_and_build
22722298
22732299 __upgrade_postgres
0 commit comments