Skip to content

Commit

Permalink
Merge pull request #521 from jonathankingfc/master
Browse files Browse the repository at this point in the history
move pipefail outside of pg_dump block
  • Loading branch information
hhorak authored Jul 21, 2023
2 parents b20805e + 3a516df commit 6a32fc1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion 10/root/usr/share/container-scripts/postgresql/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ migrate_db ()
{
test "$postinitdb_actions" = ",migration" || return 0

set -o pipefail
# Migration path.
(
set -o pipefail
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
echo '\set ON_ERROR_STOP on'
fi
Expand All @@ -260,6 +260,7 @@ migrate_db ()
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
| grep -v '^CREATE ROLE postgres;'
) | psql
set +o pipefail
}

function set_pgdata ()
Expand Down
3 changes: 2 additions & 1 deletion 12/root/usr/share/container-scripts/postgresql/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ migrate_db ()
{
test "$postinitdb_actions" = ",migration" || return 0

set -o pipefail
# Migration path.
(
set -o pipefail
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
echo '\set ON_ERROR_STOP on'
fi
Expand All @@ -260,6 +260,7 @@ migrate_db ()
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
| grep -v '^CREATE ROLE postgres;'
) | psql
set +o pipefail
}

function set_pgdata ()
Expand Down
3 changes: 2 additions & 1 deletion 13/root/usr/share/container-scripts/postgresql/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ migrate_db ()
{
test "$postinitdb_actions" = ",migration" || return 0

set -o pipefail
# Migration path.
(
set -o pipefail
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
echo '\set ON_ERROR_STOP on'
fi
Expand All @@ -260,6 +260,7 @@ migrate_db ()
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
| grep -v '^CREATE ROLE postgres;'
) | psql
set +o pipefail
}

function set_pgdata ()
Expand Down
3 changes: 2 additions & 1 deletion 14/root/usr/share/container-scripts/postgresql/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ migrate_db ()
{
test "$postinitdb_actions" = ",migration" || return 0

set -o pipefail
# Migration path.
(
set -o pipefail
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
echo '\set ON_ERROR_STOP on'
fi
Expand All @@ -260,6 +260,7 @@ migrate_db ()
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
| grep -v '^CREATE ROLE postgres;'
) | psql
set +o pipefail
}

function set_pgdata ()
Expand Down
3 changes: 2 additions & 1 deletion 15/root/usr/share/container-scripts/postgresql/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ migrate_db ()
{
test "$postinitdb_actions" = ",migration" || return 0

set -o pipefail
# Migration path.
(
set -o pipefail
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
echo '\set ON_ERROR_STOP on'
fi
Expand All @@ -260,6 +260,7 @@ migrate_db ()
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
| grep -v '^CREATE ROLE postgres;'
) | psql
set +o pipefail
}

function set_pgdata ()
Expand Down
3 changes: 2 additions & 1 deletion src/root/usr/share/container-scripts/postgresql/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ migrate_db ()
{
test "$postinitdb_actions" = ",migration" || return 0

set -o pipefail
# Migration path.
(
set -o pipefail
if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then
echo '\set ON_ERROR_STOP on'
fi
Expand All @@ -261,6 +261,7 @@ migrate_db ()
pg_dumpall -h "$POSTGRESQL_MIGRATION_REMOTE_HOST" \
| grep -v '^CREATE ROLE postgres;'
) | psql
set +o pipefail
}

function set_pgdata ()
Expand Down

0 comments on commit 6a32fc1

Please sign in to comment.