Skip to content

Commit fed2670

Browse files
committed
Added control if jsquery is alredy installed
1 parent c01a5bd commit fed2670

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

9.6/docker-entrypoint.sh

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,21 @@ if [ "$1" = 'postgres' ]; then
120120

121121
fi
122122

123-
exec gosu postgres "$@" &
124-
cd /home/
125-
git config --global http.sslVerify false
126-
git clone https://github.com/postgrespro/jsquery.git
127-
cd jsquery
128-
129-
make USE_PGXS=1
130-
sudo -u postgres psql postgres -c "CREATE USER root WITH SUPERUSER PASSWORD '$POSTGRES_PASSWORD';"
131-
sudo make USE_PGXS=1 install
132-
133-
make USE_PGXS=1 installcheck
134-
psql postgres -c "CREATE EXTENSION jsquery;"
135-
gosu postgres pg_ctl -D "$PGDATA" -m fast -w stop
123+
if [ ! -d "$DIRECTORY" ]; then
124+
exec gosu postgres "$@" &
125+
cd /home/
126+
git config --global http.sslVerify false
127+
git clone https://github.com/postgrespro/jsquery.git
128+
cd jsquery
129+
130+
make USE_PGXS=1
131+
sudo -u postgres psql postgres -c "CREATE USER root WITH SUPERUSER PASSWORD '$POSTGRES_PASSWORD';"
132+
sudo make USE_PGXS=1 install
133+
134+
make USE_PGXS=1 installcheck
135+
psql postgres -c "CREATE EXTENSION jsquery;"
136+
gosu postgres pg_ctl -D "$PGDATA" -m fast -w stop
137+
fi
136138
fi
137139

138140
exec gosu postgres "$@"

0 commit comments

Comments
 (0)