Skip to content

Commit d7ccf7d

Browse files
authored
Move GitHub Connect reset to after config-apply
1 parent 5373387 commit d7ccf7d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bin/ghe-restore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,6 @@ if is_external_database_target_or_snapshot && $SKIP_MYSQL; then
350350
else
351351
echo "Restoring MySQL database from ${backup_snapshot_strategy} backup snapshot on an appliance configured for ${appliance_strategy} backups ..."
352352
ghe-restore-mysql "$GHE_HOSTNAME" 1>&3
353-
# Clear GitHub Connect settings stored in the restored database
354-
if ! $RESTORE_SETTINGS; then
355-
echo "if [ -f /usr/local/share/enterprise/ghe-reset-gh-connect ]; then /usr/local/share/enterprise/ghe-reset-gh-connect -y; fi" |
356-
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh 1>&3
357-
fi
358353
fi
359354

360355
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.actions.enabled'; then
@@ -460,6 +455,13 @@ elif $instance_configured; then
460455
ghe-ssh "$GHE_HOSTNAME" -- "ghe-config-apply" 1>&3 2>&3
461456
fi
462457

458+
# Clear GitHub Connect settings stored in the restored database.
459+
# This needs to happen after `ghe-config-apply` to ensure all migrations have run.
460+
if ! $RESTORE_SETTINGS; then
461+
echo "if [ -f /usr/local/share/enterprise/ghe-reset-gh-connect ]; then /usr/local/share/enterprise/ghe-reset-gh-connect -y; fi" |
462+
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh 1>&3
463+
fi
464+
463465
# Start cron. Timerd will start automatically as part of the config run.
464466
echo "Starting cron ..."
465467
if $CLUSTER; then

0 commit comments

Comments
 (0)