File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
ansible/files/admin_api_scripts/pg_upgrade_scripts Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,12 @@ CI_start_postgres() {
86
86
su postgres -c " $BINDIR /pg_ctl start -o '-c config_file=/etc/postgresql/postgresql.conf' -l /tmp/postgres.log"
87
87
}
88
88
89
+ print_vault_secrets () {
90
+ run_sql << 'EOSQL '
91
+ select * from vault.secrets;
92
+ EOSQL
93
+ }
94
+
89
95
swap_postgres_and_supabase_admin () {
90
96
run_sql << 'EOSQL '
91
97
alter database postgres connection limit 0;
Original file line number Diff line number Diff line change @@ -260,10 +260,13 @@ function complete_pg_upgrade {
260
260
execute_extension_upgrade_patches || true
261
261
262
262
echo " 4. Running generated SQL files"
263
+ retry 3 print_vault_secrets
263
264
retry 3 run_generated_sql
264
265
265
266
echo " 4.1. Applying patches"
267
+ retry 3 print_vault_secrets
266
268
execute_patches || true
269
+ retry 3 print_vault_secrets
267
270
268
271
run_sql -c " ALTER USER postgres WITH NOSUPERUSER;"
269
272
Original file line number Diff line number Diff line change @@ -367,13 +367,16 @@ function initiate_upgrade {
367
367
fi
368
368
369
369
echo " 7. Disabling extensions and generating post-upgrade script"
370
+ print_vault_secrets
370
371
handle_extensions
371
372
372
373
echo " 8.1. Granting SUPERUSER to postgres user"
374
+ print_vault_secrets
373
375
run_sql -c " ALTER USER postgres WITH SUPERUSER;"
374
376
375
377
if [ " $OLD_BOOTSTRAP_USER " = " postgres" ]; then
376
378
echo " 8.2. Swap postgres & supabase_admin roles as we're upgrading a project with postgres as bootstrap user"
379
+ print_vault_secrets
377
380
swap_postgres_and_supabase_admin
378
381
fi
379
382
@@ -388,8 +391,10 @@ function initiate_upgrade {
388
391
389
392
export LD_LIBRARY_PATH=" ${PGLIBNEW} "
390
393
fi
394
+ print_vault_secrets
391
395
392
396
echo " 9. Creating new data directory, initializing database"
397
+ print_vault_secrets
393
398
chown -R postgres:postgres " $MOUNT_POINT /"
394
399
rm -rf " ${PGDATANEW:? } /"
395
400
@@ -408,6 +413,7 @@ function initiate_upgrade {
408
413
$( cat /etc/postgresql/pg_hba.conf) " > /etc/postgresql/pg_hba.conf
409
414
run_sql -c " select pg_reload_conf();"
410
415
fi
416
+ print_vault_secrets
411
417
412
418
UPGRADE_COMMAND=$( cat << EOF
413
419
time ${PGBINNEW} /pg_upgrade \
You can’t perform that action at this time.
0 commit comments