diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index fab33dd3c07d123aac8ad2f06f05b17c881136c9..0fd2c01bb045436a2b140e88c7aeebcf6bcf500d 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -72,7 +72,7 @@ review-deploy: - download_chart - date - deploy || (display_deployment_debug && exit 1) - - disable_sign_ups + - disable_sign_ups || (delete_release && exit 1) # When the job is manual, review-qa-smoke is also manual and we don't want people # to have to manually start the jobs in sequence, so we do it for them. - '[ -z $CI_JOB_MANUAL ] || play_job "review-qa-smoke"' diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh index 1a1cfbbd5f6a00523d6f025c0eeb32250df9f8e8..b8cbe625e5b6fdc82865f7a455ca29d580db4f20 100755 --- a/scripts/review_apps/review-apps.sh +++ b/scripts/review_apps/review-apps.sh @@ -137,7 +137,7 @@ function run_task() { local ruby_cmd="${1}" local task_runner_pod=$(get_pod "task-runner") - kubectl exec -it --namespace "${namespace}" "${task_runner_pod}" -- gitlab-rails runner "${ruby_cmd}" + kubectl exec --namespace "${namespace}" "${task_runner_pod}" -- gitlab-rails runner "${ruby_cmd}" } function disable_sign_ups() { @@ -150,7 +150,7 @@ function disable_sign_ups() { # Create the root token local ruby_cmd="token = User.find_by_username('root').personal_access_tokens.create(scopes: [:api], name: 'Token to disable sign-ups'); token.set_token('${REVIEW_APPS_ROOT_TOKEN}'); begin; token.save!; rescue(ActiveRecord::RecordNotUnique); end" - run_task "${ruby_cmd}" + retry "run_task \"${ruby_cmd}\"" # Disable sign-ups local signup_enabled=$(retry 'curl --silent --show-error --request PUT --header "PRIVATE-TOKEN: ${REVIEW_APPS_ROOT_TOKEN}" "${CI_ENVIRONMENT_URL}/api/v4/application/settings?signup_enabled=false" | jq ".signup_enabled"')