summaryrefslogtreecommitdiff
path: root/scripts/review_apps
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-27 12:06:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-27 12:06:30 +0000
commit3269a20692c5b1f32862072d7897a4e753bae9ef (patch)
tree9dfc6e7ccb857b323dc8b12259d339b76b8b90bf /scripts/review_apps
parentc02f53288a838166a28518983fae3b80ca5936d8 (diff)
downloadgitlab-ce-3269a20692c5b1f32862072d7897a4e753bae9ef.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/review_apps')
-rw-r--r--scripts/review_apps/base-config.yaml2
-rwxr-xr-xscripts/review_apps/review-apps.sh57
2 files changed, 27 insertions, 32 deletions
diff --git a/scripts/review_apps/base-config.yaml b/scripts/review_apps/base-config.yaml
index 7aaa7544c19..407014858b4 100644
--- a/scripts/review_apps/base-config.yaml
+++ b/scripts/review_apps/base-config.yaml
@@ -26,6 +26,8 @@ gitlab:
mailroom:
enabled: false
migrations:
+ initialRootPassword:
+ secret: shared-gitlab-initial-root-password
resources:
requests:
cpu: 350m
diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh
index 1d87b64168c..1c33bff719d 100755
--- a/scripts/review_apps/review-apps.sh
+++ b/scripts/review_apps/review-apps.sh
@@ -197,39 +197,33 @@ function install_external_dns() {
function create_application_secret() {
local namespace="${KUBE_NAMESPACE}"
local release="${CI_ENVIRONMENT_SLUG}"
-
- echoinfo "Creating the ${release}-gitlab-initial-root-password secret in the ${namespace} namespace..." true
-
- kubectl create secret generic --namespace "${namespace}" \
- "${release}-gitlab-initial-root-password" \
- --from-literal="password=${REVIEW_APPS_ROOT_PASSWORD}" \
- --dry-run -o json | kubectl apply -f -
+ local initial_root_password_shared_secret
+ local gitlab_license_shared_secret
+
+ initial_root_password_shared_secret=$(kubectl get secret --namespace ${namespace} --no-headers -o=custom-columns=NAME:.metadata.name shared-gitlab-initial-root-password | tail -n 1)
+ if [[ "${initial_root_password_shared_secret}" == "" ]]; then
+ echoinfo "Creating the 'shared-gitlab-initial-root-password' secret in the ${namespace} namespace..." true
+ kubectl create secret generic --namespace "${namespace}" \
+ "shared-gitlab-initial-root-password" \
+ --from-literal="password=${REVIEW_APPS_ROOT_PASSWORD}" \
+ --dry-run -o json | kubectl apply -f -
+ else
+ echoinfo "The 'shared-gitlab-initial-root-password' secret already exists in the ${namespace} namespace."
+ fi
if [ -z "${REVIEW_APPS_EE_LICENSE}" ]; then echo "License not found" && return; fi
- echoinfo "Creating the ${release}-gitlab-license secret in the ${namespace} namespace..." true
-
- echo "${REVIEW_APPS_EE_LICENSE}" > /tmp/license.gitlab
-
- kubectl create secret generic --namespace "${namespace}" \
- "${release}-gitlab-license" \
- --from-file=license=/tmp/license.gitlab \
- --dry-run -o json | kubectl apply -f -
-}
-
-function label_application_secret() {
- local namespace="${KUBE_NAMESPACE}"
- local release="${CI_ENVIRONMENT_SLUG}"
-
- echoinfo "Labeling the ${release}-gitlab-initial-root-password and ${release}-gitlab-license secrets in the ${namespace} namespace..." true
-
- kubectl label secret --namespace "${namespace}" \
- "${release}-gitlab-initial-root-password" \
- release="${release}"
-
- kubectl label secret --namespace "${namespace}" \
- "${release}-gitlab-license" \
- release="${release}"
+ gitlab_license_shared_secret=$(kubectl get secret --namespace ${namespace} --no-headers -o=custom-columns=NAME:.metadata.name shared-gitlab-license | tail -n 1)
+ if [[ "${gitlab_license_shared_secret}" == "" ]]; then
+ echoinfo "Creating the 'shared-gitlab-license' secret in the ${namespace} namespace..." true
+ echo "${REVIEW_APPS_EE_LICENSE}" > /tmp/license.gitlab
+ kubectl create secret generic --namespace "${namespace}" \
+ "shared-gitlab-license" \
+ --from-file=license=/tmp/license.gitlab \
+ --dry-run -o json | kubectl apply -f -
+ else
+ echoinfo "The 'shared-gitlab-license' secret already exists in the ${namespace} namespace."
+ fi
}
function download_chart() {
@@ -272,7 +266,6 @@ function deploy() {
gitlab_workhorse_image_repository="${IMAGE_REPOSITORY}/gitlab-workhorse-${edition}"
create_application_secret
- label_application_secret
HELM_CMD=$(cat << EOF
helm upgrade \
@@ -308,7 +301,7 @@ EOF
if [ -n "${REVIEW_APPS_EE_LICENSE}" ]; then
HELM_CMD=$(cat << EOF
${HELM_CMD} \
- --set global.gitlab.license.secret="${release}-gitlab-license"
+ --set global.gitlab.license.secret="shared-gitlab-license"
EOF
)
fi