Skip to content

Commit e4bacfb

Browse files
committed
tmp
1 parent 123b702 commit e4bacfb

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ CI_start_postgres() {
8686
su postgres -c "$BINDIR/pg_ctl start -o '-c config_file=/etc/postgresql/postgresql.conf' -l /tmp/postgres.log"
8787
}
8888

89+
print_vault_secrets() {
90+
run_sql <<'EOSQL'
91+
select * from vault.secrets;
92+
EOSQL
93+
}
94+
8995
swap_postgres_and_supabase_admin() {
9096
run_sql <<'EOSQL'
9197
alter database postgres connection limit 0;

ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,13 @@ function complete_pg_upgrade {
260260
execute_extension_upgrade_patches || true
261261

262262
echo "4. Running generated SQL files"
263+
retry 3 print_vault_secrets
263264
retry 3 run_generated_sql
264265

265266
echo "4.1. Applying patches"
267+
retry 3 print_vault_secrets
266268
execute_patches || true
269+
retry 3 print_vault_secrets
267270

268271
run_sql -c "ALTER USER postgres WITH NOSUPERUSER;"
269272

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,16 @@ function initiate_upgrade {
367367
fi
368368

369369
echo "7. Disabling extensions and generating post-upgrade script"
370+
print_vault_secrets
370371
handle_extensions
371372

372373
echo "8.1. Granting SUPERUSER to postgres user"
374+
print_vault_secrets
373375
run_sql -c "ALTER USER postgres WITH SUPERUSER;"
374376

375377
if [ "$OLD_BOOTSTRAP_USER" = "postgres" ]; then
376378
echo "8.2. Swap postgres & supabase_admin roles as we're upgrading a project with postgres as bootstrap user"
379+
print_vault_secrets
377380
swap_postgres_and_supabase_admin
378381
fi
379382

@@ -388,8 +391,10 @@ function initiate_upgrade {
388391

389392
export LD_LIBRARY_PATH="${PGLIBNEW}"
390393
fi
394+
print_vault_secrets
391395

392396
echo "9. Creating new data directory, initializing database"
397+
print_vault_secrets
393398
chown -R postgres:postgres "$MOUNT_POINT/"
394399
rm -rf "${PGDATANEW:?}/"
395400

@@ -408,6 +413,7 @@ function initiate_upgrade {
408413
$(cat /etc/postgresql/pg_hba.conf)" > /etc/postgresql/pg_hba.conf
409414
run_sql -c "select pg_reload_conf();"
410415
fi
416+
print_vault_secrets
411417

412418
UPGRADE_COMMAND=$(cat <<EOF
413419
time ${PGBINNEW}/pg_upgrade \

0 commit comments

Comments
 (0)