Skip to content

Commit e77921a

Browse files
committed
Always perform ghe-config-apply run after restoring into v2.x vms
1 parent 08fd493 commit e77921a

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

bin/ghe-restore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ ghe-ssh "$host" -- 'ghe-import-authorized-keys' < "$GHE_RESTORE_SNAPSHOT_PATH/au
119119
echo "Restoring Elasticsearch indices ..."
120120
ghe-restore-es-${GHE_BACKUP_STRATEGY} "$host" 1>&3
121121

122+
# Perform a config run after restoring against v2.x vms. This ensures DB
123+
# migrations are run and v1.x -> v2.x fs adjustments are made.
124+
if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
125+
echo "Configuring storage ..."
126+
ghe-ssh "$host" -- "sudo ghe-config-apply" 1>&3
127+
fi
128+
122129
echo "Restoring SSH host keys ..."
123130
ghe-ssh "$host" -- 'ghe-import-ssh-host-keys' < "$GHE_RESTORE_SNAPSHOT_PATH/ssh-host-keys.tar" 1>&3
124131

test/bin/ghe-config-apply

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
# Usage: ghe-config-apply
3+
# Emulates the remote GitHub ghe-config-apply command. Tests use this
4+
# to assert that the command was executed.
5+
set -e
6+
echo "ghe-config-apply OK"

0 commit comments

Comments
 (0)