We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbd4d46 commit 9631f37Copy full SHA for 9631f37
backend/scripts/restart_containers.sh
@@ -1,4 +1,14 @@
1
#!/bin/bash
2
+set -e
3
+
4
+cleanup() {
5
+ echo "Error occurred. Cleaning up..."
6
+ docker stop onyx_postgres onyx_vespa onyx_redis 2>/dev/null || true
7
+ docker rm onyx_postgres onyx_vespa onyx_redis 2>/dev/null || true
8
+}
9
10
+# Trap errors and output a message, then cleanup
11
+trap 'echo "Error occurred on line $LINENO. Exiting script." >&2; cleanup' ERR
12
13
# Usage of the script with optional volume arguments
14
# ./restart_containers.sh [vespa_volume] [postgres_volume] [redis_volume]
0 commit comments