Skip to content

Commit 9fff5d5

Browse files
committed
Add ghe_remote_version_required() calls for all utils that need GHE_REMOTE_XXX vars
1 parent e101998 commit 9fff5d5

7 files changed

Lines changed: 23 additions & 5 deletions

libexec/ghe-backup-es-rsync

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ cd $(dirname "$0")/..
1313
# Set up remote host and root elastic backup directory based on config
1414
host="$GHE_HOSTNAME"
1515

16+
# Perform a host-check and establish GHE_REMOTE_XXX variables.
17+
ghe_remote_version_required "$host"
18+
1619
# Verify rsync is available.
1720
if ! rsync --version 1>/dev/null 2>&1; then
1821
echo "Error: rsync not found." 1>&2

libexec/ghe-backup-pages-rsync

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ fi
1919
# Grab the host
2020
host="$GHE_HOSTNAME"
2121

22+
# Perform a host-check and establish GHE_REMOTE_XXX variables.
23+
ghe_remote_version_required "$host"
24+
2225
# Verify that the /data/pages directory exists. It won't if no pages sites have
2326
# been published under some versions.
2427
ghe-ssh "$host" -- "[ -d '$GHE_REMOTE_DATA_USER_DIR/pages' ]" || exit 0

libexec/ghe-backup-redis

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ set -e
1212
cd $(dirname "$0")/..
1313
. libexec/ghe-backup-config
1414

15+
# Perform a host-check and establish GHE_REMOTE_XXX variables.
16+
ghe_remote_version_required "$GHE_HOSTNAME"
17+
1518
# Force a redis BGSAVE, and wait for it to complete.
1619
ghe-ssh "$GHE_HOSTNAME" /bin/sh <<EOF
1720
set -e

libexec/ghe-backup-repositories-rsync

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,19 @@ backup_dir="$GHE_SNAPSHOT_DIR/repositories"
4242
# Location of last good backup for rsync --link-dest
4343
backup_current="$GHE_DATA_DIR/current/repositories"
4444

45-
# Remote sync-in-progress file location. When this file exists, Git GC
46-
# operations are disabled on the GitHub instance.
47-
sync_in_progress_file="$GHE_REMOTE_DATA_USER_DIR/repositories/.sync_in_progress"
48-
4945
# Verify rsync is available.
5046
if ! rsync --version 1>/dev/null 2>&1; then
5147
echo "Error: rsync not found." 1>&2
5248
exit 1
5349
fi
5450

51+
# Perform a host-check and establish GHE_REMOTE_XXX variables.
52+
ghe_remote_version_required "$host"
53+
54+
# Remote sync-in-progress file location. When this file exists, Git GC
55+
# operations are disabled on the GitHub instance.
56+
sync_in_progress_file="$GHE_REMOTE_DATA_USER_DIR/repositories/.sync_in_progress"
57+
5558
# Make sure root backup dir exists if this is the first run
5659
mkdir -p "$backup_dir"
5760

libexec/ghe-maintenance-mode-enable

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ done
3333
# Grab host arg
3434
host="$1"
3535

36-
# Perform a host-check and establish the remote version in GHE_REMOTE_VERSION.
36+
# Perform a host-check and establish GHE_REMOTE_XXX variables.
3737
ghe_remote_version_required "$host"
3838

3939
# Never wait on processes to complete under versions >= 2.x.

libexec/ghe-restore-pages-rsync

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ cd $(dirname "$0")/..
1616
# Grab host arg
1717
host="$1"
1818

19+
# Perform a host-check and establish GHE_REMOTE_XXX variables.
20+
ghe_remote_version_required "$host"
21+
1922
# The snapshot to restore should be set by the ghe-restore command but this lets
2023
# us run this script directly.
2124
: ${GHE_RESTORE_SNAPSHOT:=current}

libexec/ghe-restore-repositories-rsync

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ cd $(dirname "$0")/..
1616
# Grab host arg
1717
host="$1"
1818

19+
# Perform a host-check and establish GHE_REMOTE_XXX variables.
20+
ghe_remote_version_required "$host"
21+
1922
# The snapshot to restore should be set by the ghe-restore command but this lets
2023
# us run this script directly.
2124
: ${GHE_RESTORE_SNAPSHOT:=current}

0 commit comments

Comments
 (0)