Skip to content

Commit

Permalink
pipefail for better handling of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnitzel committed Jan 16, 2019
1 parent ec83d1b commit 0a377d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helpers/mariadb-single2shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ DB_PORT=$(cat $SECRETS | shyaml get-value data.DB_PORT | base64 -D)

echo "*** Transfering 'drupal' database from $OLD_POD to $DB_HOST"
# transfer database between from old to new
oc -n $1 exec $OLD_POD -- bash -c "mysqldump --max-allowed-packet=500M --events --routines --quick --add-locks --no-autocommit --single-transaction --no-create-db drupal | mysql -h $DB_HOST -u $DB_USER -p${DB_PASSWORD} -P $DB_PORT $DB_NAME"
oc -n $1 exec $OLD_POD -- bash -eo pipefail -c "mysqldump --max-allowed-packet=500M --events --routines --quick --add-locks --no-autocommit --single-transaction --no-create-db drupal | mysql -h $DB_HOST -u $DB_USER -p${DB_PASSWORD} -P $DB_PORT $DB_NAME"

CONFIG_BAK="/tmp/${PROJECT_NAME}-$(date +%F-%T)-lagoon-env.yaml"
echo "*** Backing up configmap in case we need to revert: ${CONFIG_BAK}"
Expand Down

0 comments on commit 0a377d6

Please sign in to comment.