Skip to content

Commit 6a32fc1

Browse files
authored
Merge pull request #521 from jonathankingfc/master
move pipefail outside of pg_dump block
2 parents b20805e + 3a516df commit 6a32fc1

File tree

6 files changed

+12
-6
lines changed
  • 10/root/usr/share/container-scripts/postgresql
  • 12/root/usr/share/container-scripts/postgresql
  • 13/root/usr/share/container-scripts/postgresql
  • 14/root/usr/share/container-scripts/postgresql
  • 15/root/usr/share/container-scripts/postgresql
  • src/root/usr/share/container-scripts/postgresql

6 files changed

+12
-6
lines changed

10/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ migrate_db ()
248248
{
249249
test "$postinitdb_actions" = ",migration" || return 0
250250

251+
set -o pipefail
251252
# Migration path.
252253
(
253-
set -o pipefail
254254
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
255255
echo '\set ON_ERROR_STOP on'
256256
fi
@@ -260,6 +260,7 @@ migrate_db ()
260260
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
261261
| grep -v '^CREATE ROLE postgres;'
262262
) | psql
263+
set +o pipefail
263264
}
264265

265266
function set_pgdata ()

12/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ migrate_db ()
248248
{
249249
test "$postinitdb_actions" = ",migration" || return 0
250250

251+
set -o pipefail
251252
# Migration path.
252253
(
253-
set -o pipefail
254254
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
255255
echo '\set ON_ERROR_STOP on'
256256
fi
@@ -260,6 +260,7 @@ migrate_db ()
260260
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
261261
| grep -v '^CREATE ROLE postgres;'
262262
) | psql
263+
set +o pipefail
263264
}
264265

265266
function set_pgdata ()

13/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ migrate_db ()
248248
{
249249
test "$postinitdb_actions" = ",migration" || return 0
250250

251+
set -o pipefail
251252
# Migration path.
252253
(
253-
set -o pipefail
254254
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
255255
echo '\set ON_ERROR_STOP on'
256256
fi
@@ -260,6 +260,7 @@ migrate_db ()
260260
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
261261
| grep -v '^CREATE ROLE postgres;'
262262
) | psql
263+
set +o pipefail
263264
}
264265

265266
function set_pgdata ()

14/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ migrate_db ()
248248
{
249249
test "$postinitdb_actions" = ",migration" || return 0
250250

251+
set -o pipefail
251252
# Migration path.
252253
(
253-
set -o pipefail
254254
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
255255
echo '\set ON_ERROR_STOP on'
256256
fi
@@ -260,6 +260,7 @@ migrate_db ()
260260
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
261261
| grep -v '^CREATE ROLE postgres;'
262262
) | psql
263+
set +o pipefail
263264
}
264265

265266
function set_pgdata ()

15/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ migrate_db ()
248248
{
249249
test "$postinitdb_actions" = ",migration" || return 0
250250

251+
set -o pipefail
251252
# Migration path.
252253
(
253-
set -o pipefail
254254
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
255255
echo '\set ON_ERROR_STOP on'
256256
fi
@@ -260,6 +260,7 @@ migrate_db ()
260260
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
261261
| grep -v '^CREATE ROLE postgres;'
262262
) | psql
263+
set +o pipefail
263264
}
264265

265266
function set_pgdata ()

src/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ migrate_db ()
249249
{
250250
test "$postinitdb_actions" = ",migration" || return 0
251251

252+
set -o pipefail
252253
# Migration path.
253254
(
254-
set -o pipefail
255255
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
256256
echo '\set ON_ERROR_STOP on'
257257
fi
@@ -261,6 +261,7 @@ migrate_db ()
261261
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
262262
| grep -v '^CREATE ROLE postgres;'
263263
) | psql
264+
set +o pipefail
264265
}
265266

266267
function set_pgdata ()

0 commit comments

Comments
 (0)