File tree Expand file tree Collapse file tree 6 files changed +32
-2
lines changed
share/github-backup-utils Expand file tree Collapse file tree 6 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,9 @@ if [ "$GHE_BACKUP_STRATEGY" = "tarball" ]; then
121
121
GHE_MAINTENANCE_MODE_ENABLED=true
122
122
fi
123
123
124
+ ghe-backup-store-version ||
125
+ echo " Warning: storing backup-utils version remotely failed."
126
+
124
127
echo " Backing up GitHub settings ..."
125
128
ghe-backup-settings ||
126
129
failures=" $failures settings"
Original file line number Diff line number Diff line change 37
37
if [ $rc -ne 0 ]; then
38
38
case $rc in
39
39
255)
40
- if echo " $output " | grep -i " port 22: connection refused\|port 22: no route to host\|Connection timed out during banner exchange" > /dev/null; then
40
+ if echo " $output " | grep -i " port 22: connection refused\|port 22: no route to host\|ssh_exchange_identification: Connection closed by remote host\| Connection timed out during banner exchange" > /dev/null; then
41
41
exec " bin/$( basename $0 ) " " $hostname :122"
42
42
fi
43
43
Original file line number Diff line number Diff line change @@ -187,6 +187,9 @@ if $instance_configured; then
187
187
fi
188
188
fi
189
189
190
+ ghe-backup-store-version ||
191
+ echo " Warning: storing backup-utils version remotely failed."
192
+
190
193
# Restore settings and license if restoring to an unconfigured appliance or when
191
194
# specified manually.
192
195
if $restore_settings ; then
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # / Usage: ghe-backup-store-version
3
+ # / Stores information about the used version of backup-utils on <host>
4
+ set -e
5
+
6
+ # Bring in the backup configuration
7
+ cd $( dirname " $0 " ) /../..
8
+ . share/github-backup-utils/ghe-backup-config
9
+
10
+ if [ -d .git ]; then
11
+ version_info=" $BACKUP_UTILS_VERSION "
12
+ ref=$( git rev-parse HEAD || true)
13
+ if [ -n " $ref " ]; then
14
+ version_info=" $version_info :$ref "
15
+ fi
16
+ echo " $version_info " |
17
+ ghe-ssh " $GHE_HOSTNAME " -- " sudo dd of=$GHE_REMOTE_DATA_USER_DIR /common/backup-utils-version"
18
+ fi
Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ begin_test "ghe-backup first snapshot"
131
131
# verify all alambic assets user data was transferred
132
132
diff -ru " $GHE_REMOTE_DATA_USER_DIR /alambic_assets" " $GHE_DATA_DIR /current/alambic_assets"
133
133
fi
134
+
135
+ # verify that ghe-backup wrote its version information to the host
136
+ [ -f " $GHE_REMOTE_DATA_USER_DIR /common/backup-utils-version" ]
134
137
)
135
138
end_test
136
139
Original file line number Diff line number Diff line change @@ -497,7 +497,7 @@ begin_test "cluster: ghe-restore from v2.5.0 snapshot"
497
497
export GHE_RESTORE_HOST
498
498
499
499
# create file used to determine if instance is in maintenance mode.
500
- mkdir -p " $GHE_REMOTE_DATA_DIR /github/current/public/system"
500
+ mkdir -p " $GHE_REMOTE_DATA_DIR /github/current/public/system" " $GHE_REMOTE_DATA_USER_DIR /common "
501
501
touch " $GHE_REMOTE_DATA_DIR /github/current/public/system/maintenance.html"
502
502
503
503
echo " v2.5.0" > " $GHE_DATA_DIR /current/version"
@@ -508,5 +508,8 @@ begin_test "cluster: ghe-restore from v2.5.0 snapshot"
508
508
: ghe-restore should have exited successfully
509
509
false
510
510
fi
511
+
512
+ # verify that ghe-backup wrote its version information to the host
513
+ [ -f " $GHE_REMOTE_DATA_USER_DIR /common/backup-utils-version" ]
511
514
)
512
515
end_test
You can’t perform that action at this time.
0 commit comments