Skip to content

Commit cd0462f

Browse files
authored
Merge pull request #437 from github/enterprise-3.8-backport-318-eptekov-pages-lazybuild
Backport 318 for 3.8: Adding new option to support Pages lazy-build strategy
2 parents b27a0d0 + 6755336 commit cd0462f

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

backup.config-example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ GHE_NUM_SNAPSHOTS=10
9595
# When running an external mysql database, run this script to trigger a MySQL restore
9696
# rather than attempting to backup via backup-utils directly.
9797
#EXTERNAL_DATABASE_RESTORE_SCRIPT="/bin/false"
98+
99+
# If set to 'yes', Pages data will be included in backup and restore. Defaults to 'yes'
100+
#GHE_BACKUP_PAGES=no

bin/ghe-backup

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,15 @@ commands+=("
240240
echo \"$cmd_title\"
241241
ghe-backup-repositories || printf %s \"repositories \" >> \"$failures_file\"")
242242

243-
cmd_title=$(log_info "Backing up GitHub Pages artifacts ...")
244-
commands+=("
245-
echo \"$cmd_title\"
246-
ghe-backup-pages || printf %s \"pages \" >> \"$failures_file\"")
243+
# Pages backups are skipped only if GHE_BACKUP_PAGES is explicitly set to 'no' to guarantee backward compatibility.
244+
# If a customer upgrades backup-utils but keeps the config file from a previous version, Pages backups still work as expected.
245+
246+
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
247+
cmd_title=$(log_info "Backing up GitHub Pages artifacts ...")
248+
commands+=("
249+
echo \"$cmd_title\"
250+
ghe-backup-pages || printf %s \"pages \" >> \"$failures_file\"")
251+
fi
247252

248253
cmd_title=$(log_info "Backing up storage data ...")
249254
commands+=("

bin/ghe-restore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,12 @@ commands+=("
469469
echo \"$cmd_title\"
470470
ghe-restore-repositories-gist \"$GHE_HOSTNAME\"")
471471

472-
cmd_title=$(log_info "Restoring Pages ...")
473-
commands+=("
474-
echo \"$cmd_title\"
475-
ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
472+
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
473+
cmd_title=$(log_info "Restoring Pages ...")
474+
commands+=("
475+
echo \"$cmd_title\"
476+
ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
477+
fi
476478

477479
cmd_title=$(log_info "Restoring SSH authorized keys ...")
478480
commands+=("

0 commit comments

Comments
 (0)