diff --git a/assets/runtime/functions b/assets/runtime/functions index 1674fa62..9d7cc6ba 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -1197,12 +1197,6 @@ migrate_database() { COUNT=$(PGPASSWORD="${DB_PASS}" psql -h ${DB_HOST} -p ${DB_PORT} -U ${DB_USER} -d ${DB_NAME} -Atw -c "${QUERY}") ;; esac - if [[ -z ${COUNT} || ${COUNT} -eq 0 ]]; then - echo "Setting up GitLab for firstrun. Please be patient, this could take a while..." - exec_as_git force=yes bundle exec rake gitlab:setup \ - ${GITLAB_ROOT_PASSWORD:+GITLAB_ROOT_PASSWORD=$GITLAB_ROOT_PASSWORD} \ - ${GITLAB_ROOT_EMAIL:+GITLAB_ROOT_EMAIL=$GITLAB_ROOT_EMAIL} >/dev/null - fi # migrate database if the gitlab version has changed. CACHE_VERSION= @@ -1243,6 +1237,13 @@ migrate_database() { rm -rf ${GITLAB_TEMP_DIR}/GITLAB_RELATIVE_URL_ROOT # force cache cleanup fi + if [[ -z ${COUNT} || ${COUNT} -eq 0 ]]; then + echo "Setting up GitLab for firstrun. Please be patient, this could take a while..." + exec_as_git force=yes bundle exec rake gitlab:setup \ + ${GITLAB_ROOT_PASSWORD:+GITLAB_ROOT_PASSWORD=$GITLAB_ROOT_PASSWORD} \ + ${GITLAB_ROOT_EMAIL:+GITLAB_ROOT_EMAIL=$GITLAB_ROOT_EMAIL} >/dev/null + fi + # clear cache if relative_url has changed. [[ -f ${GITLAB_TEMP_DIR}/GITLAB_RELATIVE_URL_ROOT ]] && CACHE_GITLAB_RELATIVE_URL_ROOT=$(cat ${GITLAB_TEMP_DIR}/GITLAB_RELATIVE_URL_ROOT) if [[ ! -f ${GITLAB_TEMP_DIR}/GITLAB_RELATIVE_URL_ROOT || ${GITLAB_RELATIVE_URL_ROOT} != ${CACHE_GITLAB_RELATIVE_URL_ROOT} ]]; then