Skip to content

Commit 37426d4

Browse files
authored
Merge pull request #185 from github/ashishkeshan/add-wait-for-ha-proxy
2 parents 58aadea + 087da21 commit 37426d4

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

share/github-backup-utils/ghe-restore-mysql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ snapshot_dir="$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT"
3232
if is_external_database_snapshot; then
3333
if [ -n "$EXTERNAL_DATABASE_RESTORE_SCRIPT" ]; then
3434
$EXTERNAL_DATABASE_RESTORE_SCRIPT
35+
# ensure that haproxy and mysql are ready to accept connections before continuing
36+
if ! ghe-ssh "$GHE_HOSTNAME" -- "/usr/local/share/enterprise/ghe-service-wait-mysql"; then
37+
error_message "Failed to connect to MySQL service!"
38+
exit 2
39+
fi
3540
bm_end "$(basename $0)"
3641
exit 0
3742
else

test/bin/ghe-es-snapshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# Usage: ghe-es-snapshot
3-
# Emulates the remote GitHub ghe-service-ensure-mysql command. Tests use this
3+
# Emulates the remote GitHub ghe-service-es-mysql command. Tests use this
44
# to assert that the command was executed.
55
set -e
66
echo "ghe-es-snapshot OK"

test/bin/ghe-service-wait-mysql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
# Usage: ghe-service-wait-mysql
3+
# Emulates the remote GitHub ghe-service-wait-mysql command. Tests use this
4+
# to assert that the command was executed.
5+
set -e
6+
echo "ghe-service-wait-mysql OK"

0 commit comments

Comments
 (0)