Pull changes from upstream repository

This commit is contained in:
Marek Skalický 2018-11-06 14:17:45 +00:00
commit f409f0a74f
No known key found for this signature in database
GPG key ID: ADCAA1DEE100A66D
46 changed files with 5661 additions and 0 deletions

View file

@ -0,0 +1,36 @@
#! /usr/bin/bash -x
# fail early
set -e
# source the convenience tooling
source "${CONTAINER_SCRIPTS_PATH}/common.sh"
# set $PGDATA variable
set_pgdata
# assert uninitialized data
test ! -f "$PGDATA/postgresql.conf"
# empty config file is needed after 'initialize_database' call
touch "$POSTGRESQL_CONFIG_FILE"
initialize_database
# start local PostgreSQL server (wait with '-w')
pg_ctl -w start -o "-h ''"
# load all sql files
shopt -s nullglob
for file in /tmp/src/init/*.sql; do
psql -f "$file"
done
pg_ctl stop
# dump the data into $PWD (in-image storage)
tar caf data.tar.xz -C "$PGDATA" .
rm -rf "$PGDATA"
# install pre-start hook
cp -r /tmp/src/postgresql-pre-start .

View file

@ -0,0 +1,2 @@
CREATE TABLE test (sth TEXT);
INSERT INTO test VALUES ('hello world');

View file

@ -0,0 +1,3 @@
if test ! -f "$PGDATA/postgresql.conf"; then
tar xf "$APP_DATA"/src/data.tar.xz -C "$PGDATA"
fi