Content-Length: 785327 | pFad | http://github.com/aditya232/postgres/commit/#start-of-content

688620FD Merge pull request #452 from infosiftr/initdb-fails · aditya232/postgres@b927923 · GitHub
Skip to content

Commit b927923

Browse files
authored
Merge pull request docker-library#452 from infosiftr/initdb-fails
Allow "initdb.d" scripts to be executed instead of sourced
2 parents 3f8d33c + eff90ef commit b927923

13 files changed

+143
-13
lines changed

10/alpine/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

10/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

11/alpine/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

11/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

9.3/alpine/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

9.3/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

9.4/alpine/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

9.4/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

9.5/alpine/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

9.5/docker-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
142142
echo
143143
for f in /docker-entrypoint-initdb.d/*; do
144144
case "$f" in
145-
*.sh) echo "$0: running $f"; . "$f" ;;
145+
*.sh)
146+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
147+
# https://github.com/docker-library/postgres/pull/452
148+
if [ -x "$f" ]; then
149+
echo "$0: running $f"
150+
"$f"
151+
else
152+
echo "$0: sourcing $f"
153+
. "$f"
154+
fi
155+
;;
146156
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
147157
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
148158
*) echo "$0: ignoring $f" ;;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/aditya232/postgres/commit/#start-of-content

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy