Skip to content
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

Merged
merged 3 commits into from
Mar 17, 2023

Conversation

hubertdeng123
Copy link
Member

@hubertdeng123 hubertdeng123 commented Mar 14, 2023

  1. adds backup and restore scripts
  2. added error reporting to both of the scripts
  3. consolidate utility scripts to a helper script file

@hubertdeng123 hubertdeng123 force-pushed the hubertdeng123/add-reset-backup-scripts branch from 41d2c6c to 15d4ae0 Compare March 14, 2023 23:44
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
Copy link
Member

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.

@hubertdeng123 hubertdeng123 force-pushed the hubertdeng123/add-reset-backup-scripts branch from 15d4ae0 to d9dae7d Compare March 17, 2023 00:27
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
set -eEuo pipefail
Copy link
Member Author

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

Copy link
Member

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. :)

@hubertdeng123 hubertdeng123 marked this pull request as ready for review March 17, 2023 00:32
@hubertdeng123 hubertdeng123 mentioned this pull request Mar 17, 2023
2 tasks
Copy link
Member

@chadwhitacre chadwhitacre left a 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 into scripts for now
  • rename clean.sh back to reset.sh
  • DRY up the {backup,reset,restore}.sh scripts amap (while keeping separate .sh files)

@hubertdeng123 hubertdeng123 force-pushed the hubertdeng123/add-reset-backup-scripts branch from 0b0eb3f to 56bd583 Compare March 17, 2023 19:51
Copy link
Member

@chadwhitacre chadwhitacre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it! :)

@hubertdeng123 hubertdeng123 merged commit 8fc2933 into master Mar 17, 2023
@hubertdeng123 hubertdeng123 deleted the hubertdeng123/add-reset-backup-scripts branch March 17, 2023 20:52
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants