2024-05-28 15:21:18 +05:30
|
|
|
#!/bin/bash
|
|
|
|
|
|
2024-06-28 13:08:13 +05:30
|
|
|
if [ "$BUILD_TYPE" == "full" ]; then
|
2024-05-28 15:21:18 +05:30
|
|
|
|
2024-06-28 13:08:13 +05:30
|
|
|
export PGHOST=localhost
|
2024-05-28 15:21:18 +05:30
|
|
|
|
2024-06-28 13:08:13 +05:30
|
|
|
sudo -u postgres "/usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_ctl" -D /var/lib/postgresql/data start
|
|
|
|
|
sudo -u postgres "/usr/lib/postgresql/${POSTGRES_VERSION}/bin/psql" --command "CREATE USER $POSTGRES_USER WITH SUPERUSER PASSWORD '$POSTGRES_PASSWORD';" && \
|
|
|
|
|
sudo -u postgres "/usr/lib/postgresql/${POSTGRES_VERSION}/bin/createdb" -O "$POSTGRES_USER" "$POSTGRES_DB" && \
|
|
|
|
|
sudo -u postgres "/usr/lib/postgresql/${POSTGRES_VERSION}/bin/psql" --command "GRANT ALL PRIVILEGES ON DATABASE $POSTGRES_DB TO $POSTGRES_USER;" && \
|
|
|
|
|
sudo -u postgres "/usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_ctl" -D /var/lib/postgresql/data stop
|
|
|
|
|
|
|
|
|
|
fi
|
2024-05-28 15:21:18 +05:30
|
|
|
|