-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Backup/restore scripts #2029
Conversation
hubertdeng123
commented
Mar 14, 2023
•
edited
Loading
edited
- adds backup and restore scripts
- added error reporting to both of the scripts
- consolidate utility scripts to a helper script file
41d2c6c
to
15d4ae0
Compare
utilities.sh
Outdated
} | ||
|
||
function backup() { | ||
docker-compose run -v $(pwd)/sentry:/sentry-data/backup --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export /sentry-data/backup/backup.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd ensure the permissions here with chmod +w
or something.
15d4ae0
to
d9dae7d
Compare
@@ -1,12 +1,12 @@ | |||
#!/usr/bin/env bash | |||
set -euo pipefail | |||
set -eEuo pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we're not including the -E
flag generally? If an error is thrown in a function, our cleanup function actually doesn't catch it properly and treats it as the EXIT
trap code instead of ERR
. Found that out in this PR
https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we're not including the
-E
flag generally?
No good one that I know of. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brainstormed #2035, buuuuuuuuut ...
- move everything from
utilities
intoscripts
for now - rename
clean.sh
back toreset.sh
- DRY up the
{backup,reset,restore}.sh
scripts amap (while keeping separate .sh files)
0b0eb3f
to
56bd583
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it! :)