mysql-backup-s3: set '-o pipefail' to catch errors when database not found
Hi,
You have 'set -e' at the top of the backup.sh script.
Right now, the mysqldump ...|gzip... command wont fail if mysqldump returns an error.
If you add
set -eo pipefail
It'll catch that. You could also add `set -euo pipefail' to catch unset variables too.
I assume this affects other images you have too.
@byrnedo That's a good idea. Could you please make a PR ?
@OlivierCuyp done. Sh doesn't support -u and either way it would have probably broken certain scripts, so I just changed it to -eo pipefail. Are there any tests one can run to confirm?
@byrnedo sorry for the late answer. There no real tests. From what I read I guess you tested it on your side. If you confirm so I would merge the PR.
No, haven't tested it
Ok, I'll dedicate some time to test it then ;)
I can help out too, not sure how one would test this though, so many different images. Any opinion on what tools to use to test this? Bats or Goss?
Hi @byrnedo, thanks for your proposal. I have no experience with both of these test frameworks. I would say choose the one you feel more confortable with.