@@ -85,23 +85,16 @@ restore-secret "Actions Launch service private key" "actions-launch-app-app-priv
85
85
restore-secret " Actions Launch token oauth key" " actions-oauth-s2s-signing-key" " secrets.launch.token-oauth-key"
86
86
restore-secret " Actions Launch token oauth cert" " actions-oauth-s2s-signing-cert" " secrets.launch.token-oauth-cert"
87
87
88
- # Restore storage container prefix, but only if the `-c` option is used with ghe-restore
89
- # `-c` should be used if restoring to an unconfigured appliance or when sif restoring to an unconfigured appliance or when
90
- # specified manually.
91
- # This is to avoid a staging instance using the same bucket prefix settings as production in the case of a staging instance restored from production
92
- if $RESTORE_SETTINGS ; then
93
- restore-secret " Actions storage container prefix" " actions-storage-container-prefix" " secrets.actions.storage.container-prefix"
94
- fi
95
88
# Restore storage container prefix, but only if the `-c` option is used with ghe-restore to avoid staging instances using production bucket settings
96
89
# 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
90
+ if [ -n " $GHE_RESTORE_SNAPSHOT_PATH " ]; then
91
+ snapshot_version=$( cat $GHE_RESTORE_SNAPSHOT_PATH /version)
92
+ # shellcheck disable=SC2046 # Word splitting is required to populate the variables
93
+ read -r snapshot_version_major snapshot_version_minor _ <<< $( ghe_parse_version $snapshot_version )
94
+ if [ " $snapshot_version_major " -eq " 3 " -a " $ snapshot_version_minor" -ge " 9 " -a $RESTORE_SETTINGS ]; then
95
+ restore-secret " Actions storage container prefix" " actions-storage-container-prefix" " secrets.actions.storage.container-prefix"
96
+ fi
97
+ fi
105
98
106
99
# Setup the database logins.
107
100
ghe_verbose " * Restoring database logins and users to $host ..."
0 commit comments