Skip to content

Commit

Permalink
Move GitHub Connect reset to after config-apply
Browse files Browse the repository at this point in the history
  • Loading branch information
lildude authored Sep 16, 2021
1 parent 5373387 commit d7ccf7d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/ghe-restore
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,6 @@ if is_external_database_target_or_snapshot && $SKIP_MYSQL; then
else
echo "Restoring MySQL database from ${backup_snapshot_strategy} backup snapshot on an appliance configured for ${appliance_strategy} backups ..."
ghe-restore-mysql "$GHE_HOSTNAME" 1>&3
# Clear GitHub Connect settings stored in the restored database
if ! $RESTORE_SETTINGS; then
echo "if [ -f /usr/local/share/enterprise/ghe-reset-gh-connect ]; then /usr/local/share/enterprise/ghe-reset-gh-connect -y; fi" |
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh 1>&3
fi
fi

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

# Clear GitHub Connect settings stored in the restored database.
# This needs to happen after `ghe-config-apply` to ensure all migrations have run.
if ! $RESTORE_SETTINGS; then
echo "if [ -f /usr/local/share/enterprise/ghe-reset-gh-connect ]; then /usr/local/share/enterprise/ghe-reset-gh-connect -y; fi" |
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh 1>&3
fi

# Start cron. Timerd will start automatically as part of the config run.
echo "Starting cron ..."
if $CLUSTER; then
Expand Down

0 comments on commit d7ccf7d

Please sign in to comment.