Skip to content

Update initdb-postgis.sh script to account for upstream changes #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 9.0-2.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM postgres:9.0
MAINTAINER Mike Dillon <mike@embody.org>
MAINTAINER Mike Dillon <mike@appropriate.io>

ENV POSTGIS_MAJOR 2.1
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
Expand Down
22 changes: 14 additions & 8 deletions 9.0-2.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/sh
POSTGRES="gosu postgres postgres"

$POSTGRES --single -E <<EOSQL
CREATE DATABASE template_postgis
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
set -e

# Perform all actions as user 'postgres'
export PGUSER=postgres

# Create the 'template_postgis' template db
psql <<EOSQL
CREATE DATABASE template_postgis;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
EOSQL

POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
# Populate 'template_postgis'
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
psql --dbname template_postgis < postgis.sql
psql --dbname template_postgis < topology.sql
psql --dbname template_postgis < spatial_ref_sys.sql
2 changes: 1 addition & 1 deletion 9.1-2.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM postgres:9.1
MAINTAINER Mike Dillon <mike@embody.org>
MAINTAINER Mike Dillon <mike@appropriate.io>

ENV POSTGIS_MAJOR 2.1
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
Expand Down
22 changes: 14 additions & 8 deletions 9.1-2.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/sh
POSTGRES="gosu postgres postgres"

$POSTGRES --single -E <<EOSQL
CREATE DATABASE template_postgis
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
set -e

# Perform all actions as user 'postgres'
export PGUSER=postgres

# Create the 'template_postgis' template db
psql <<EOSQL
CREATE DATABASE template_postgis;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
EOSQL

POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
# Populate 'template_postgis'
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
psql --dbname template_postgis < postgis.sql
psql --dbname template_postgis < topology.sql
psql --dbname template_postgis < spatial_ref_sys.sql
2 changes: 1 addition & 1 deletion 9.2-2.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM postgres:9.2
MAINTAINER Mike Dillon <mike@embody.org>
MAINTAINER Mike Dillon <mike@appropriate.io>

ENV POSTGIS_MAJOR 2.1
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
Expand Down
22 changes: 14 additions & 8 deletions 9.2-2.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/sh
POSTGRES="gosu postgres postgres"

$POSTGRES --single -E <<EOSQL
CREATE DATABASE template_postgis
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
set -e

# Perform all actions as user 'postgres'
export PGUSER=postgres

# Create the 'template_postgis' template db
psql <<EOSQL
CREATE DATABASE template_postgis;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
EOSQL

POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
# Populate 'template_postgis'
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
psql --dbname template_postgis < postgis.sql
psql --dbname template_postgis < topology.sql
psql --dbname template_postgis < spatial_ref_sys.sql
2 changes: 1 addition & 1 deletion 9.3-2.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM postgres:9.3
MAINTAINER Mike Dillon <mike@embody.org>
MAINTAINER Mike Dillon <mike@appropriate.io>

ENV POSTGIS_MAJOR 2.1
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
Expand Down
22 changes: 14 additions & 8 deletions 9.3-2.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/sh
POSTGRES="gosu postgres postgres"

$POSTGRES --single -E <<EOSQL
CREATE DATABASE template_postgis
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
set -e

# Perform all actions as user 'postgres'
export PGUSER=postgres

# Create the 'template_postgis' template db
psql <<EOSQL
CREATE DATABASE template_postgis;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
EOSQL

POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
# Populate 'template_postgis'
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
psql --dbname template_postgis < postgis.sql
psql --dbname template_postgis < topology.sql
psql --dbname template_postgis < spatial_ref_sys.sql
2 changes: 1 addition & 1 deletion 9.4-2.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM postgres:9.4
MAINTAINER Mike Dillon <mike@embody.org>
MAINTAINER Mike Dillon <mike@appropriate.io>

ENV POSTGIS_MAJOR 2.1
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
Expand Down
22 changes: 14 additions & 8 deletions 9.4-2.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/sh
POSTGRES="gosu postgres postgres"

$POSTGRES --single -E <<EOSQL
CREATE DATABASE template_postgis
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
set -e

# Perform all actions as user 'postgres'
export PGUSER=postgres

# Create the 'template_postgis' template db
psql <<EOSQL
CREATE DATABASE template_postgis;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
EOSQL

POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
# Populate 'template_postgis'
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
psql --dbname template_postgis < postgis.sql
psql --dbname template_postgis < topology.sql
psql --dbname template_postgis < spatial_ref_sys.sql
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Mike Dillon <mike@embody.org>
Mike Dillon <mike@appropriate.io>

And other contributors not specifically named here.
2 changes: 1 addition & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM postgres:%%PG_MAJOR%%
MAINTAINER Mike Dillon <mike@embody.org>
MAINTAINER Mike Dillon <mike@appropriate.io>

ENV POSTGIS_MAJOR %%POSTGIS_MAJOR%%
ENV POSTGIS_VERSION %%POSTGIS_VERSION%%
Expand Down
22 changes: 14 additions & 8 deletions initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/sh
POSTGRES="gosu postgres postgres"

$POSTGRES --single -E <<EOSQL
CREATE DATABASE template_postgis
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
set -e

# Perform all actions as user 'postgres'
export PGUSER=postgres

# Create the 'template_postgis' template db
psql <<EOSQL
CREATE DATABASE template_postgis;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
EOSQL

POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
# Populate 'template_postgis'
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
psql --dbname template_postgis < postgis.sql
psql --dbname template_postgis < topology.sql
psql --dbname template_postgis < spatial_ref_sys.sql