summaryrefslogtreecommitdiff
path: root/scripts/review_apps
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-09 09:10:18 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-09 09:10:18 +0000
commit82a546b14c7613fe355b3e68c425d5da8779641a (patch)
treeb7bce66a952a66375e0e4eeb8cbedc38c9479ebf /scripts/review_apps
parenta5628d3b6d9b74f5902f790ceddd6374148c9d71 (diff)
downloadgitlab-ce-82a546b14c7613fe355b3e68c425d5da8779641a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/review_apps')
-rwxr-xr-xscripts/review_apps/review-apps.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh
index c1d274af56d..80b239b7e0d 100755
--- a/scripts/review_apps/review-apps.sh
+++ b/scripts/review_apps/review-apps.sh
@@ -127,13 +127,12 @@ function disable_sign_ups() {
fi
# 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"
- retry "run_task \"${ruby_cmd}\""
+ local set_token_rb="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"
+ retry "run_task \"${set_token_rb}\""
# 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"')
-
- if [[ "${signup_enabled}" == "false" ]]; then
+ local disable_signup_rb="Gitlab::CurrentSettings.current_application_settings.update!(signup_enabled: false)"
+ if (retry "run_task \"${disable_signup_rb}\""); then
echoinfo "Sign-ups have been disabled successfully."
else
echoerr "Sign-ups are still enabled!"
@@ -365,6 +364,18 @@ EOF
eval "${HELM_CMD}"
}
+function verify_deploy() {
+ echoinfo "Verifying deployment at ${CI_ENVIRONMENT_URL}"
+
+ if wait_for_url "${CI_ENVIRONMENT_URL}" curl_output.txt; then
+ echoinfo "Review app is deployed to ${CI_ENVIRONMENT_URL}"
+ return 0
+ else
+ echoerr "Review app is not available at ${CI_ENVIRONMENT_URL}. See curl_output.txt artifact for detail."
+ return 1
+ fi
+}
+
function display_deployment_debug() {
local namespace="${CI_ENVIRONMENT_SLUG}"
local release="${CI_ENVIRONMENT_SLUG}"