From b7a61813aca21f9acfdbd624955cc0580f4b9895 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Thu, 18 Jul 2024 13:48:19 -0700 Subject: [PATCH] CLI-1362: [push:db] mysqldump failure not surfaced --- src/Command/CommandBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index 70e64e3d0..2f17d3788 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -1692,10 +1692,10 @@ protected function createMySqlDumpOnLocal(string $dbHost, string $dbUser, string $outputCallback('out', "Dumping MySQL database to $localFilepath on this machine"); } if ($this->localMachineHelper->commandExists('pv')) { - $command = "MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | pv --rate --bytes | gzip -9 > $localFilepath"; + $command = "bash -c \"set -o pipefail; MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | pv --rate --bytes | gzip -9 > $localFilepath\""; } else { $this->io->warning('Install `pv` to see progress bar'); - $command = "MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | gzip -9 > $localFilepath"; + $command = "bash -c \"set -o pipefail; MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | gzip -9 > $localFilepath\""; } $process = $this->localMachineHelper->executeFromCmd($command, $outputCallback, null, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));