1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-11-17 13:02:40 +03:00

Merge pull request #118 from orzeh/master

Stops docker-entrypoint.sh on psql error
This commit is contained in:
yosifkit
2016-01-19 12:37:27 -08:00
7 changed files with 35 additions and 7 deletions

View File

@@ -77,7 +77,11 @@ if [ "$1" = 'postgres' ]; then
for f in /docker-entrypoint-initdb.d/*; do for f in /docker-entrypoint-initdb.d/*; do
case "$f" in case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;; *.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *.sql)
echo "$0: running $f";
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f"
echo
;;
*) echo "$0: ignoring $f" ;; *) echo "$0: ignoring $f" ;;
esac esac
echo echo

View File

@@ -77,7 +77,11 @@ if [ "$1" = 'postgres' ]; then
for f in /docker-entrypoint-initdb.d/*; do for f in /docker-entrypoint-initdb.d/*; do
case "$f" in case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;; *.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *.sql)
echo "$0: running $f";
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f"
echo
;;
*) echo "$0: ignoring $f" ;; *) echo "$0: ignoring $f" ;;
esac esac
echo echo

View File

@@ -77,7 +77,11 @@ if [ "$1" = 'postgres' ]; then
for f in /docker-entrypoint-initdb.d/*; do for f in /docker-entrypoint-initdb.d/*; do
case "$f" in case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;; *.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *.sql)
echo "$0: running $f";
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f"
echo
;;
*) echo "$0: ignoring $f" ;; *) echo "$0: ignoring $f" ;;
esac esac
echo echo

View File

@@ -77,7 +77,11 @@ if [ "$1" = 'postgres' ]; then
for f in /docker-entrypoint-initdb.d/*; do for f in /docker-entrypoint-initdb.d/*; do
case "$f" in case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;; *.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *.sql)
echo "$0: running $f";
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f"
echo
;;
*) echo "$0: ignoring $f" ;; *) echo "$0: ignoring $f" ;;
esac esac
echo echo

View File

@@ -77,7 +77,11 @@ if [ "$1" = 'postgres' ]; then
for f in /docker-entrypoint-initdb.d/*; do for f in /docker-entrypoint-initdb.d/*; do
case "$f" in case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;; *.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *.sql)
echo "$0: running $f";
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f"
echo
;;
*) echo "$0: ignoring $f" ;; *) echo "$0: ignoring $f" ;;
esac esac
echo echo

View File

@@ -77,7 +77,11 @@ if [ "$1" = 'postgres' ]; then
for f in /docker-entrypoint-initdb.d/*; do for f in /docker-entrypoint-initdb.d/*; do
case "$f" in case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;; *.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *.sql)
echo "$0: running $f";
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f"
echo
;;
*) echo "$0: ignoring $f" ;; *) echo "$0: ignoring $f" ;;
esac esac
echo echo

View File

@@ -77,7 +77,11 @@ if [ "$1" = 'postgres' ]; then
for f in /docker-entrypoint-initdb.d/*; do for f in /docker-entrypoint-initdb.d/*; do
case "$f" in case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;; *.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *.sql)
echo "$0: running $f";
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f"
echo
;;
*) echo "$0: ignoring $f" ;; *) echo "$0: ignoring $f" ;;
esac esac
echo echo