From 48cfc38f5282acac860e24bbe84f49f017527993 Mon Sep 17 00:00:00 2001 From: Jackson West Date: Thu, 12 Jan 2023 08:51:40 -0600 Subject: [PATCH] Fixes update windows base image tag files in other repos --- .../update_base_image_other_repos.sh | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/eks-distro-base/update_base_image_other_repos.sh b/eks-distro-base/update_base_image_other_repos.sh index 126a950c9..943158ec9 100755 --- a/eks-distro-base/update_base_image_other_repos.sh +++ b/eks-distro-base/update_base_image_other_repos.sh @@ -27,21 +27,22 @@ REPOS=(eks-distro eks-anywhere-build-tooling eks-anywhere) for repo in "${REPOS[@]}"; do ${SCRIPT_ROOT}/../pr-scripts/update_local_branch.sh "$repo" done - -while IFS=, read -r image -do - image=${image:2} # strip leading - space - BASE_IMAGE_TAG_FILE="$(echo ${image^^} | tr '-' '_')_TAG_FILE" - IMAGE_TAG=$(yq e ".al$AL_TAG.\"$image\"" $SCRIPT_ROOT/../EKS_DISTRO_TAG_FILE.yaml) - # we will set the tag to null to trigger new builds. we dont want PRs being open setting - # tag file values to null - if [[ "${IMAGE_TAG}" = "null" ]]; then - continue - fi - for repo in "${REPOS[@]}"; do - ${SCRIPT_ROOT}/../pr-scripts/update_image_tag.sh "$repo" '.*' $IMAGE_TAG $BASE_IMAGE_TAG_FILE - done -done < <(yq e ".al$AL_TAG | keys" $SCRIPT_ROOT/../EKS_DISTRO_TAG_FILE.yaml) +for key in "al$AL_TAG" "windows"; do + while IFS=, read -r image + do + image=${image:2} # strip leading - space + BASE_IMAGE_TAG_FILE="$(echo ${image^^} | tr '-' '_')_TAG_FILE" + IMAGE_TAG=$(yq e ".$key.\"$image\"" $SCRIPT_ROOT/../EKS_DISTRO_TAG_FILE.yaml) + # we will set the tag to null to trigger new builds. we dont want PRs being open setting + # tag file values to null + if [[ "${IMAGE_TAG}" = "null" ]]; then + continue + fi + for repo in "${REPOS[@]}"; do + ${SCRIPT_ROOT}/../pr-scripts/update_image_tag.sh "$repo" '.*' $IMAGE_TAG $BASE_IMAGE_TAG_FILE + done + done < <(yq e ".$key | keys" $SCRIPT_ROOT/../EKS_DISTRO_TAG_FILE.yaml) +done for repo in "${REPOS[@]}"; do ${SCRIPT_ROOT}/../pr-scripts/create_pr.sh "$repo" 'EKS_DISTRO*_TAG_FILE'