From 545088842bde56df9e03b88963142a692e9ceea7 Mon Sep 17 00:00:00 2001 From: Izaac Zavaleta Date: Mon, 27 Nov 2023 09:18:31 -0700 Subject: [PATCH] Use the latest Rancher chart to use during the Rancher installation when the Jenkins job type is recurring. --- cypress/jenkins/Jenkinsfile_multi | 1 - cypress/jenkins/init.sh | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cypress/jenkins/Jenkinsfile_multi b/cypress/jenkins/Jenkinsfile_multi index ca6135fff15..cd7a508a854 100644 --- a/cypress/jenkins/Jenkinsfile_multi +++ b/cypress/jenkins/Jenkinsfile_multi @@ -58,7 +58,6 @@ node { string(name: 'DASHBOARD_BRANCH', value: "${DASHBOARD_BRANCH}"), string(name: 'CYPRESS_TAGS', value: ct), string(name: 'RANCHER_HOST', value: ""), - string(name: 'RANCHER_VERSION', value: "${RANCHER_VERSION}"), string(name: 'RANCHER_USERNAME', value: "${RANCHER_USERNAME}"), string(name: 'RANCHER_PASSWORD', value: "${RANCHER_PASSWORD}"), string(name: 'RKE2_KUBERNETES_VERSION', value: "${RKE2_KUBERNETES_VERSION}"), diff --git a/cypress/jenkins/init.sh b/cypress/jenkins/init.sh index 013318deccb..6dda09704d6 100755 --- a/cypress/jenkins/init.sh +++ b/cypress/jenkins/init.sh @@ -77,6 +77,14 @@ corral config vars set volume_iops ${AWS_VOLUME_IOPS} if [[ "${JOB_TYPE}" == "recurring" ]]; then RANCHER_TYPE="recurring" + if [[ -n "${RANCHER_IMAGE_TAG}" ]]; then + curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash + helm repo add rancher-latest https://releases.rancher.com/server-charts/latest + helm repo update + version_string=$(echo "${RANCHER_IMAGE_TAG}" | cut -f1 -d"-") + RANCHER_VERSION=$(helm search repo rancher-latest --devel --versions | grep ${version_string} | head -n 1 | cut -f2 | tr -d '[:space:]') + corral config vars set rancher_image_tag ${RANCHER_IMAGE_TAG} + fi cd "${WORKSPACE}/corral-packages" yq -i e ".variables.rancher_version += [\"${RANCHER_VERSION}\"] | .variables.rancher_version style=\"literal\"" packages/aws/rancher.yaml yq -i e ".variables.kubernetes_version += [\"${RKE2_KUBERNETES_VERSION}\"] | .variables.kubernetes_version style=\"literal\"" packages/aws/rancher.yaml @@ -90,9 +98,6 @@ if [[ "${JOB_TYPE}" == "recurring" ]]; then corral config vars set bootstrap_password ${BOOTSTRAP_PASSWORD:-password} corral config vars set aws_route53_zone ${AWS_ROUTE53_ZONE} - if [[ -n "${RANCHER_IMAGE_TAG}" ]]; then - corral config vars set rancher_image_tag ${RANCHER_IMAGE_TAG} - fi corral config vars set server_count ${SERVER_COUNT:-3} corral config vars set agent_count ${AGENT_COUNT:-0} corral config vars set instance_type ${AWS_INSTANCE_TYPE}