UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 01bc36a7 authored by Brendon Lloyd's avatar Brendon Lloyd Committed by Micah Nagel
Browse files

Change hardcoded references to "chart/values.yaml" and "tests/ci/k3d/values.yaml" to variables

parent e3eb8bbf
No related branches found
No related tags found
1 merge request!899Change hardcoded references to "chart/values.yaml" and "tests/ci/k3d/values.yaml" to variables
......@@ -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.
......
......@@ -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
......@@ -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
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment