postgis/ci/berrie64/pg_init_start.sh
Regina Obe 352fe49e96 Refactor berrie scripts
Move shared env variables to configs.sh
Set to build with custom compiled geos (main branch)
Turn off garden testing on berries cause it hangs on ST_MaximumInscribed
References https://trac.osgeo.org/postgis/ticket/5023 for PostGIS 3.2.0
2021-11-24 22:56:20 -05:00

37 lines
919 B
Bash

#!/usr/bin/env bash
#Berrie64 is a 64-bit Rasberry Pi Arm managed by Bruce Rindahl
#This is script to launch custom compiled PostgreSQL
#export label=berrie64 #this is passed in via Jenkins
SCRIPT=$(readlink -f "$0")
export CUR_DIR=$(dirname "$SCRIPT")
echo $CUR_DIR
export CONFIG_FILE="$CUR_DIR/configs.sh"
. $CONFIG_FILE
echo $PATH
export PGDATA=$PGPATH/data_${PGPORT}
export PGLOG="$PGDATA/pgsql.log"
# What to use to start up the postmaster
DAEMON="$PGPATH/bin/pg_ctl -D $PGDATA -o '-F' -l logfile start"
# What to use to shut down the postmaster
PGCTL="$PGPATH/bin/pg_ctl"
# remove cluster if exists
if [ -d $PGDATA ] ; then
if [ -d $PGDATA/postmaster.pid] ; then
$PGCTL stop -D $PGDATA -s -m fast
fi;
rm -rf $PGDATA
fi;
#initialize cluster
$PGPATH/bin/initdb
echo -n "Starting PostgreSQL: "
$DAEMON &
#sleep a bit because sometimes postgres takes a bit to start up
sleep 20
echo "ok"
exit 0