-
-
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 opt in error monitoring to reset and clean scripts #2021
Add opt in error monitoring to reset and clean scripts #2021
Conversation
Here's a new one:
|
is this an issue that you're seeing after running the script? |
clean.sh
Outdated
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.
moved a significant part of this file to docker_cleanup
so that this can serve as a top level file for error-reporting
Not a fan of this diff. Why the excessive duplication? The only thing different is the logfile name and the $ diff -rub clean.sh reset.sh
--- clean.sh 2023-03-14 17:46:08
+++ reset.sh 2023-03-14 17:46:08
@@ -1,11 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
+# Variables needing default values set in order to source install/error-handling
MINIMIZE_DOWNTIME="${MINIMIZE_DOWNTIME:-}"
STOP_TIMEOUT=60
+MSYSTEM="${MSYSTEM:-}"
# Save logs in order to send envelope to Sentry
-log_file=sentry_clean_log-$(date +'%Y-%m-%d_%H-%M-%S').txt
+log_file=sentry_reset_log-$(date +'%Y-%m-%d_%H-%M-%S').txt
exec &> >(tee -a "$log_file")
version=$1
@@ -23,3 +25,4 @@
source install/error-handling.sh
trap_with_arg cleanup ERR INT TERM EXIT
source docker_cleanup.sh $version
+source install.sh
|
1932e15
to
66181e0
Compare
How's this instead? Still some duplicate code but it's much cleaner $ diff -rub clean.sh reset.sh
--- clean.sh 2023-03-14 16:27:17
+++ reset.sh 2023-03-14 16:27:17
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
-log_name=clean
+# Needed variable to source install script
+MSYSTEM="${MSYSTEM:-}"
+log_name=reset
+
source set-up-error-reporting-for-scripts.sh
source docker-cleanup.sh
+source install.sh |
Adds error monitoring to
reset.sh
andclean.sh