Upgrade versions (#248)

This commit is contained in:
galewis2
2022-03-28 09:12:13 -04:00
committed by GitHub
parent e6e8c2d427
commit f1203714c1
7 changed files with 51 additions and 42 deletions

10
run.sh
View File

@@ -3,9 +3,9 @@
set -euo pipefail
function createPostgresConfig() {
cp /etc/postgresql/12/main/postgresql.custom.conf.tmpl /etc/postgresql/12/main/conf.d/postgresql.custom.conf
sudo -u postgres echo "autovacuum = $AUTOVACUUM" >> /etc/postgresql/12/main/conf.d/postgresql.custom.conf
cat /etc/postgresql/12/main/conf.d/postgresql.custom.conf
cp /etc/postgresql/14/main/postgresql.custom.conf.tmpl /etc/postgresql/14/main/conf.d/postgresql.custom.conf
sudo -u postgres echo "autovacuum = $AUTOVACUUM" >> /etc/postgresql/14/main/conf.d/postgresql.custom.conf
cat /etc/postgresql/14/main/conf.d/postgresql.custom.conf
}
function setPostgresPassword() {
@@ -28,8 +28,8 @@ set -x
if [ "$1" = "import" ]; then
# Ensure that database directory is in right state
chown postgres:postgres -R /var/lib/postgresql
if [ ! -f /var/lib/postgresql/12/main/PG_VERSION ]; then
sudo -u postgres /usr/lib/postgresql/12/bin/pg_ctl -D /var/lib/postgresql/12/main/ initdb -o "--locale C.UTF-8"
if [ ! -f /var/lib/postgresql/14/main/PG_VERSION ]; then
sudo -u postgres /usr/lib/postgresql/14/bin/pg_ctl -D /var/lib/postgresql/14/main/ initdb -o "--locale C.UTF-8"
fi
# Initialize PostgreSQL