Skip to content

Commit 4210881

Browse files
committed
allow backups on gheboot for testing
1 parent d83e008 commit 4210881

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

share/github-backup-utils/ghe-backup-config

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,13 @@ export GHE_DATA_DIR
372372
: "${GHE_RELEASE_FILE:="/etc/github/enterprise-release"}"
373373

374374
# Check that utils are not being run directly on GHE appliance.
375-
if [ -f "$GHE_RELEASE_FILE" ]; then
376-
echo "Error: Backup Utils cannot be run on the GitHub Enterprise host." 1>&2
377-
echo " The backup utilities should be run on a host dedicated to" 1>&2
378-
echo " long-term permanent storage and must have network connectivity" 1>&2
379-
echo " with the GitHub Enterprise appliance." 1>&2
380-
exit 1
381-
fi
375+
# if [ -f "$GHE_RELEASE_FILE" ]; then
376+
# echo "Error: Backup Utils cannot be run on the GitHub Enterprise host." 1>&2
377+
# echo " The backup utilities should be run on a host dedicated to" 1>&2
378+
# echo " long-term permanent storage and must have network connectivity" 1>&2
379+
# echo " with the GitHub Enterprise appliance." 1>&2
380+
# exit 1
381+
# fi
382382

383383
GHE_CREATE_DATA_DIR=${GHE_CREATE_DATA_DIR:-yes}
384384

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ restore-secret "Actions Launch token oauth cert" "actions-oauth-s2s-signing-cert
9292
if $RESTORE_SETTINGS; then
9393
restore-secret "Actions storage container prefix" "actions-storage-container-prefix" "secrets.actions.storage.container-prefix"
9494
fi
95+
# Restore storage container prefix, but only if the `-c` option is used with ghe-restore to avoid staging instances using production bucket settings
96+
# This value will only be present in backups from versions >= 3.10 so needs to be wrapped in version checks.
97+
# if [ -n "$GHE_RESTORE_SNAPSHOT_PATH" ]; then
98+
# snapshot_version=$(cat $GHE_RESTORE_SNAPSHOT_PATH/version)
99+
# # shellcheck disable=SC2046 # Word splitting is required to populate the variables
100+
# read -r snapshot_version_major snapshot_version_minor _ <<<$(ghe_parse_version $snapshot_version)
101+
# if [ "$(version $snapshot_version_major.$snapshot_version_minor.0)" -a $RESTORE_SETTINGS ]; then
102+
# restore-secret "Actions storage container prefix" "actions-storage-container-prefix" "secrets.actions.storage.container-prefix"
103+
# fi
104+
# fi
95105

96106
# Setup the database logins.
97107
ghe_verbose "* Restoring database logins and users to $host ..."

share/github-backup-utils/track-progress

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ progress(){
77

88
PROGRESS=$(cat /tmp/backup-utils-progress)
99
PROGRESS_TYPE=$(cat /tmp/backup-utils-progress-type)
10-
PROGRESS_PERCENT=$( echo "scale = 2; ($PROGRESS / $PROGRESS_TOTAL) * 100" | bc)
10+
PROGRESS_PERCENT=$( echo "scale = 2; ($PROGRESS / $PROGRESS_TOTAL) * 100")
1111
echo $((PROGRESS +1)) > /tmp/backup-utils-progress
1212
echo "${PROGRESS_TYPE} progress: $PROGRESS_PERCENT % ($PROGRESS / $PROGRESS_TOTAL ) $1 " > /tmp/backup-utils-progress-info
1313
}

0 commit comments

Comments
 (0)