Skip to content

Commit dd98786

Browse files
FIX: restore exit code 77 after the PostgreSQL 15 update
This corrects an oversight from 66a4854. The second rebuild offers an opportunity to perform additional steps after the upgrade, but before re-deploying the app on the new version. This is especially useful in automated deployment workflows. This also maintains compat for those already using this feature.
1 parent bea8166 commit dd98786

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

templates/postgres.15.template.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ run:
9292
9393
if [ "$free_disk" -lt "$required" ]; then
9494
echo
95+
echo -------------------------------------------------------------------------------------
9596
echo "WARNING: Upgrading PostgreSQL would require an additional $(numfmt --to=si $(($required - $free_disk))) of disk space"
9697
echo "Please free up some space, or expand your disk, before continuing."
9798
echo
9899
echo 'To avoid upgrading change "templates/postgres.template.yml" TO "templates/postgres.13.template.yml" in containers/app.yml'
99100
echo 'You can run "./launcher start app" to restart your app in the meanwhile.'
101+
echo -------------------------------------------------------------------------------------
100102
exit 1
101103
fi
102104
@@ -137,7 +139,13 @@ run:
137139
echo UPGRADE OF POSTGRES COMPLETE
138140
echo
139141
echo Old ${PG_MAJOR_OLD} database is stored at /shared/postgres_data_old
142+
echo
143+
echo To complete the upgrade, rebuild again using:
144+
echo
145+
echo ./launcher rebuild app
140146
echo -------------------------------------------------------------------------------------
147+
# Magic exit status to denote no failure
148+
exit 77
141149
fi
142150
143151
- replace:

templates/postgres.template.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ run:
9292
9393
if [ "$free_disk" -lt "$required" ]; then
9494
echo
95+
echo -------------------------------------------------------------------------------------
9596
echo "WARNING: Upgrading PostgreSQL would require an additional $(numfmt --to=si $(($required - $free_disk))) of disk space"
9697
echo "Please free up some space, or expand your disk, before continuing."
9798
echo
9899
echo 'To avoid upgrading change "templates/postgres.template.yml" TO "templates/postgres.13.template.yml" in containers/app.yml'
99100
echo 'You can run "./launcher start app" to restart your app in the meanwhile.'
101+
echo -------------------------------------------------------------------------------------
100102
exit 1
101103
fi
102104
@@ -137,7 +139,13 @@ run:
137139
echo UPGRADE OF POSTGRES COMPLETE
138140
echo
139141
echo Old ${PG_MAJOR_OLD} database is stored at /shared/postgres_data_old
142+
echo
143+
echo To complete the upgrade, rebuild again using:
144+
echo
145+
echo ./launcher rebuild app
140146
echo -------------------------------------------------------------------------------------
147+
# Magic exit status to denote no failure
148+
exit 77
141149
fi
142150
143151
- replace:

0 commit comments

Comments
 (0)