Skip to content

Commit 2fc631d

Browse files
authored
Merge pull request #220 from lcarva/RHTAP-4845
Handle new placeholder image
2 parents 5587401 + 9f6ab49 commit 2fc631d

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

hack/wait-for-gitops-update.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ GITHUB_REPO=https://github.com/$MY_GITHUB_USER/tssc-dev-gitops
55
GITLAB_REPO=https://gitlab.com/$MY_GITLAB_USER/tssc-dev-gitops
66
JENKINS_REPO=https://github.com/$MY_GITHUB_USER/tssc-dev-gitops-jenkins
77

8+
DEFAULT_INIT_IMAGES=(
9+
'quay.io/redhat-appstudio/dance-bootstrap-app:latest'
10+
'registry.redhat.io/ubi9/httpd-24:latest'
11+
)
12+
813
WORK=$(mktemp -d)
914

1015
GH_LOCAL=$WORK/gh-gitops
@@ -34,11 +39,20 @@ function promoteIfUpdated() {
3439
DEFAULT_INIT_IMAGE="quay.io/redhat-appstudio/dance-bootstrap-app:latest"
3540
if [[ "${!PREV_IMAGE_ENV_NAME}" != "$CURRENT_IMAGE" ]]; then
3641
echo "$REPO dev changes, from ${!PREV_IMAGE_ENV_NAME} to $CURRENT_IMAGE"
37-
if [[ "$CURRENT_IMAGE" == "$DEFAULT_INIT_IMAGE" ]]; then
38-
echo "Image changed back to default, skipping using PR to promote image"
39-
else
42+
43+
is_default=false
44+
for default_image in "${DEFAULT_INIT_IMAGES[@]}"; do
45+
if [[ "$CURRENT_IMAGE" == "$default_image" ]]; then
46+
echo "Image changed back to default, skipping using PR to promote image"
47+
is_default=true
48+
break
49+
fi
50+
done
51+
52+
if ! "$is_default"; then
4053
bash $SCRIPTDIR/rhtap-promote --repo $REPO
4154
fi
55+
4256
eval "$PREV_IMAGE_ENV_NAME"="$CURRENT_IMAGE"
4357
fi
4458
}

rhtap/gather-deploy-images.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
33
# gather-deploy-images
44
source $SCRIPTDIR/common.sh
55

6-
# Top level parameters
6+
DEFAULT_INIT_IMAGES=(
7+
'quay.io/redhat-appstudio/dance-bootstrap-app:latest'
8+
'registry.redhat.io/ubi9/httpd-24:latest'
9+
)
710

811
function get-images-per-env() {
912
echo "Running $TASK_NAME:get-images-per-env"
@@ -23,11 +26,12 @@ function get-images-per-env() {
2326
yaml_path=components/${component_name}/overlays/${env}/deployment-patch.yaml
2427
image=$(yq "$IMAGE_PATH" "$yaml_path")
2528

26-
# Workaround for RHTAPBUGS-1284
27-
if [[ "$image" =~ quay.io/redhat-appstudio/dance-bootstrap-app ]]; then
28-
# Don't check the dance-bootstrap-app image
29-
continue
30-
fi
29+
for default_image in "${DEFAULT_INIT_IMAGES[@]}"; do
30+
if [[ "$image" == "$default_image" ]]; then
31+
# Don't check the default placeholder images
32+
continue 2 # Go to the next iteration of outer loop, different environment.
33+
fi
34+
done
3135

3236
if [ -n "$TARGET_BRANCH" ]; then
3337
prev_image=$(git show "origin/$TARGET_BRANCH:$yaml_path" | yq "$IMAGE_PATH")

0 commit comments

Comments
 (0)