@@ -22,14 +22,11 @@ GHE_HOSTNAME="$1"
22
22
# us run this script directly.
23
23
: ${GHE_RESTORE_SNAPSHOT:= current}
24
24
25
- # Path to snapshot dir we're restoring from
26
- GHE_RESTORE_SNAPSHOT_PATH=" $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT "
27
-
28
25
port=$( ssh_port_part " $GHE_HOSTNAME " )
29
26
host=$( ssh_host_part " $GHE_HOSTNAME " )
30
27
31
28
# No need to restore anything, early exit
32
- if [ ! -d " $GHE_RESTORE_SNAPSHOT_PATH /actions" ]; then
29
+ if [ ! -d " $GHE_DATA_DIR / $GHE_RESTORE_SNAPSHOT /actions" ]; then
33
30
echo " Warning: Actions backup missing. Skipping ..."
34
31
exit 0
35
32
fi
38
35
ghe_remote_version_required " $host "
39
36
40
37
# Transfer all Actions data from the snapshot to the user data directory using rsync.
41
- ghe_verbose " * Transferring Actions files to $host ..."
38
+ ghe_verbose " * Transferring actions files to $host ..."
42
39
43
40
echo " sudo mkdir -p $GHE_REMOTE_DATA_USER_DIR /actions" |
44
41
ghe-ssh -p $port $host /bin/bash
45
42
46
43
ghe-rsync -arvHR --delete \
47
44
-e " ghe-ssh -p $port " \
48
45
--rsync-path=' sudo -u actions rsync' \
49
- " $GHE_RESTORE_SNAPSHOT_PATH /actions/./" \
46
+ " $GHE_DATA_DIR / $GHE_RESTORE_SNAPSHOT /actions/./" \
50
47
" $host :$GHE_REMOTE_DATA_USER_DIR /actions/" 1>&3
51
48
52
- # Restore Actions settings.
53
- ghe_verbose " * Restoring Actions settings to $host ..."
54
-
55
- restore-secret " Actions configuration database login" " actions-config-db-login" " secrets.actions.ConfigurationDatabaseSqlLogin"
56
- restore-secret " Actions configuration database password" " actions-config-db-password" " secrets.actions.ConfigurationDatabaseSqlPassword"
57
- restore-secret " Actions framework access token key secret" " actions-framework-access-token" " secrets.actions.FrameworkAccessTokenKeySecret"
58
- restore-secret " Actions Url signing HMAC key primary" " actions-url-signing-hmac-key-primary" " secrets.actions.UrlSigningHmacKeyPrimary"
59
- restore-secret " Actions Url signing HMAC key secondary" " actions-url-signing-hmac-key-secondary" " secrets.actions.UrlSigningHmacKeySecondary"
60
- restore-secret " Actions OAuth S2S signing cert" " actions-oauth-s2s-signing-cert" " secrets.actions.OAuthS2SSigningCert"
61
- restore-secret " Actions OAuth S2S signing key" " actions-oauth-s2s-signing-key" " secrets.actions.OAuthS2SSigningKey"
62
- restore-secret " Actions OAuth S2S signing cert thumbprint" " actions-oauth-s2s-signing-cert-thumbprint" " secrets.actions.OAuthS2SSigningCertThumbprint"
63
- restore-secret " Actions primary encryption cert thumbprint" " actions-primary-encryption-cert-thumbprint" " secrets.actions.PrimaryEncryptionCertificateThumbprint"
64
- restore-secret " Actions AAD cert thumbprint" " actions-aad-cert-thumbprint" " secrets.actions.AADCertThumbprint"
65
- restore-secret " Actions delegated auth cert thumbprint" " actions-delegated-auth-cert-thumbprint" " secrets.actions.DelegatedAuthCertThumbprint"
66
- restore-secret " Actions runtime service principal cert" " actions-runtime-service-principal-cert" " secrets.actions.RuntimeServicePrincipalCertificate"
67
- restore-secret " Actions S2S encryption cert" " actions-s2s-encryption-cert" " secrets.actions.S2SEncryptionCertificate"
68
- restore-secret " Actions secondary encryption cert thumbprint" " actions-secondary-encryption-cert-thumbprint" " secrets.actions.SecondaryEncryptionCertificateThumbprint"
69
- restore-secret " Actions service principal cert" " actions-service-principal-cert" " secrets.actions.ServicePrincipalCertificate"
70
- restore-secret " Actions SPS validation cert thumbprint" " actions-sps-validation-cert-thumbprint" " secrets.actions.SpsValidationCertThumbprint"
71
-
72
49
bm_end " $( basename $0 ) "
0 commit comments