diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 79077b4b0bff91b5915bb5035c7aa4d60adb4fa9..d6057514126f0431614ac84d7bce7bb774b486b7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,6 +48,8 @@ variables: IMAGE_LIST: images.txt IMAGE_PKG: images.tar.gz REPOS_PKG: repositories.tar.gz + VALUES_FILE: chart/values.yaml + CI_VALUES_FILE: tests/ci/k3d/values.yaml #----------------------------------------------------------------------------------------------------------------------- # Pre Stage Jobs. This execute before any job is run. diff --git a/scripts/package/gits.sh b/scripts/package/gits.sh index 98da1ec193117c18d7c0a15a8c3821f78f40694b..44e0caec23802b3d10eb9070200feff40e6da14b 100755 --- a/scripts/package/gits.sh +++ b/scripts/package/gits.sh @@ -8,11 +8,11 @@ mkdir -p repos/ git -C repos/ clone -b ${CI_COMMIT_REF_NAME} ${CI_PROJECT_URL} # Clone core -yq e ".*.git.repo | select(. != null) | path | .[-3] " "chart/values.yaml" | while IFS= read -r package; do - git -C repos/ clone --no-checkout $(yq e ".${package}.git.repo" "chart/values.yaml") +yq e ".*.git.repo | select(. != null) | path | .[-3] " "${VALUES_FILE}" | while IFS= read -r package; do + git -C repos/ clone --no-checkout $(yq e ".${package}.git.repo" "${VALUES_FILE}") done # Clone addons -yq e ".addons.*.git.repo | select(. != null) | path | .[-3]" "chart/values.yaml" | while IFS= read -r package; do - git -C repos/ clone --no-checkout $(yq e ".addons.${package}.git.repo" "chart/values.yaml") +yq e ".addons.*.git.repo | select(. != null) | path | .[-3]" "${VALUES_FILE}" | while IFS= read -r package; do + git -C repos/ clone --no-checkout $(yq e ".addons.${package}.git.repo" "${VALUES_FILE}") done diff --git a/tests/deploy/01_deploy_bigbang.sh b/tests/deploy/01_deploy_bigbang.sh index ccb79ca3b7a7c4ab52fca92f017c338db94caf9a..692d679e3f385ed91cce9492feb26bd774108011 100755 --- a/tests/deploy/01_deploy_bigbang.sh +++ b/tests/deploy/01_deploy_bigbang.sh @@ -2,8 +2,6 @@ set -ex -CI_VALUES_FILE="tests/ci/k3d/values.yaml" - if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]] || [[ ! -z "$CI_COMMIT_TAG" ]] || [[ $CI_MERGE_REQUEST_LABELS =~ "all-packages" ]]; then echo "all-packages label enabled, or on default branch or tag, enabling all addons" yq e ".addons.*.enabled = "true"" $CI_VALUES_FILE > tmpfile && mv tmpfile $CI_VALUES_FILE @@ -18,7 +16,7 @@ else fi # if keycloak enabled add ingress passthrough cert to addons.keycloak.ingress -if [ "$(yq e ".addons.keycloak.enabled" "tests/ci/k3d/values.yaml")" == "true" ]; then +if [ "$(yq e ".addons.keycloak.enabled" "${CI_VALUES_FILE}")" == "true" ]; then yq eval-all 'select(fileIndex == 0) * select(filename == "tests/ci/keycloak-certs/keycloak-passthrough-values.yaml")' $CI_VALUES_FILE tests/ci/keycloak-certs/keycloak-passthrough-values.yaml > tmpfile && mv tmpfile $CI_VALUES_FILE #if keycloak is enabled add passthrough ingress gateway and gateway to istio. yq eval-all 'select(filename == "tests/ci/k3d/values.yaml") * select(filename == "tests/ci/passthrough-gateway.yaml")' $CI_VALUES_FILE tests/ci/passthrough-gateway.yaml > tmpfile && mv tmpfile $CI_VALUES_FILE @@ -52,4 +50,3 @@ else # NOTE: $CI_COMMIT_REF_NAME = $CI_COMMIT_TAG when running on a tagged build cat tests/ci/shared-secrets.yaml | sed 's|branch: master|tag: '"$CI_COMMIT_REF_NAME"'|g' | kubectl apply -f - fi - diff --git a/tests/deploy/02_wait_for_helmreleases.sh b/tests/deploy/02_wait_for_helmreleases.sh index 24c27f7cab2dd6d239e2cb3c434f5909190de1bd..016e8ef2a563c02662ddbc7dc45026804509282b 100755 --- a/tests/deploy/02_wait_for_helmreleases.sh +++ b/tests/deploy/02_wait_for_helmreleases.sh @@ -120,12 +120,12 @@ function wait_daemonset(){ # Check for and run the wait_project function within <repo>/tests/wait.sh to wait for custom resources function wait_crd(){ set +e - yq e '. | keys | .[] | ... comments=""' "chart/values.yaml" | while IFS= read -r package; do - if [[ "$(yq e ".${package}.enabled" "chart/values.yaml")" == "true" ]]; then - gitrepo=$(yq e ".${package}.git.repo" "chart/values.yaml") - version=$(yq e ".${package}.git.tag" "chart/values.yaml") + yq e '. | keys | .[] | ... comments=""' "${VALUES_FILE}" | while IFS= read -r package; do + if [[ "$(yq e ".${package}.enabled" "${VALUES_FILE}")" == "true" ]]; then + gitrepo=$(yq e ".${package}.git.repo" "${VALUES_FILE}") + version=$(yq e ".${package}.git.tag" "${VALUES_FILE}") if [[ -z "$version" ]]; then - version=$(yq e ".${package}.git.branch" "chart/values.yaml") + version=$(yq e ".${package}.git.branch" "${VALUES_FILE}") fi if [[ -z "$version" || "$version" == "null" ]]; then continue