File tree Expand file tree Collapse file tree 3 files changed +18
-8
lines changed
share/github-backup-utils Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -372,13 +372,13 @@ export GHE_DATA_DIR
372
372
: " ${GHE_RELEASE_FILE:= " /etc/github/enterprise-release" } "
373
373
374
374
# 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
382
382
383
383
GHE_CREATE_DATA_DIR=${GHE_CREATE_DATA_DIR:- yes}
384
384
Original file line number Diff line number Diff line change @@ -92,6 +92,16 @@ restore-secret "Actions Launch token oauth cert" "actions-oauth-s2s-signing-cert
92
92
if $RESTORE_SETTINGS ; then
93
93
restore-secret " Actions storage container prefix" " actions-storage-container-prefix" " secrets.actions.storage.container-prefix"
94
94
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
95
105
96
106
# Setup the database logins.
97
107
ghe_verbose " * Restoring database logins and users to $host ..."
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ progress(){
7
7
8
8
PROGRESS=$( cat /tmp/backup-utils-progress)
9
9
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" )
11
11
echo $(( PROGRESS + 1 )) > /tmp/backup-utils-progress
12
12
echo " ${PROGRESS_TYPE} progress: $PROGRESS_PERCENT % ($PROGRESS / $PROGRESS_TOTAL ) $1 " > /tmp/backup-utils-progress-info
13
13
}
You can’t perform that action at this time.
0 commit comments