Skip to content

Commit

Permalink
Set pipefail
Browse files Browse the repository at this point in the history
  • Loading branch information
max-muoto committed Dec 31, 2024
1 parent df8af64 commit 6a82b05
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pgclone/dump_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ def _dump(*, exclude, config, pre_dump_hooks, instance, database, storage_locati
[f"--exclude-table-data={table_name}" for table_name in exclude_tables]
)
# Note - do note format {db_dump_url} with an `f` string.
# It will be formatted later when running the command
pg_dump_cmd_fmt = "pg_dump -Fc --no-acl --no-owner {db_dump_url} " + exclude_args
# It will be formatted later when running the command.
# Set -o pipefail to ensure that the pipeline fails if any command in it fails.
pg_dump_cmd_fmt = (
"set -o pipefail; pg_dump -Fc --no-acl --no-owner {db_dump_url} " + exclude_args
)
pg_dump_cmd_fmt += " " + storage_client.pg_dump(file_path)

anon_pg_dump_cmd = pg_dump_cmd_fmt.format(db_dump_url="<DB_URL>")
Expand Down

0 comments on commit 6a82b05

Please sign in to comment.