Skip to content

Commit 08368ff

Browse files
authored
Merge pull request #426 from github/lildude/rsync-for-pages-pre-213
Use old rsync restore method for pages prior to 2.13
2 parents 20c0e61 + 04b9aea commit 08368ff

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

bin/ghe-restore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,17 @@ if $CLUSTER || [ "$(version $GHE_REMOTE_VERSION)" -ge "$(version 2.13.0)" ]; the
275275

276276
echo "Restoring Gists ..."
277277
ghe-restore-repositories-gist "$GHE_HOSTNAME"
278+
279+
echo "Restoring GitHub Pages ..."
280+
ghe-restore-pages "$GHE_HOSTNAME" 1>&3
278281
else
279282
echo "Restoring Git repositories and Gists ..."
280283
ghe-restore-repositories-rsync "$GHE_HOSTNAME" 1>&3
284+
285+
echo "Restoring GitHub Pages ..."
286+
ghe-restore-pages-rsync "$GHE_HOSTNAME" 1>&3
281287
fi
282288

283-
echo "Restoring GitHub Pages ..."
284-
ghe-restore-pages "$GHE_HOSTNAME" 1>&3
285289

286290
echo "Restoring SSH authorized keys ..."
287291
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-import-authorized-keys' < "$GHE_RESTORE_SNAPSHOT_PATH/authorized-keys.json" 1>&3
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
#/ Usage: ghe-restore-pages-rsync <host>
3+
#/ Restore an rsync snapshot of all Pages data to a GitHub instance.
4+
#/
5+
#/ Note: This script typically isn't called directly. It's invoked by the
6+
#/ ghe-restore command when the rsync strategy is used.
7+
set -e
8+
9+
# Bring in the backup configuration
10+
# shellcheck source=share/github-backup-utils/ghe-backup-config
11+
. "$( dirname "${BASH_SOURCE[0]}" )/ghe-backup-config"
12+
13+
# Show usage and bail with no arguments
14+
[ -z "$*" ] && print_usage
15+
16+
bm_start "$(basename $0)"
17+
18+
# Restore all pages data via rsync
19+
ghe-restore-userdata pages "$1"
20+
21+
bm_end "$(basename $0)"

0 commit comments

Comments
 (0)