File tree Expand file tree Collapse file tree 2 files changed +27
-9
lines changed Expand file tree Collapse file tree 2 files changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ GITHUB_REPO=https://github.com/$MY_GITHUB_USER/tssc-dev-gitops
5
5
GITLAB_REPO=https://gitlab.com/$MY_GITLAB_USER /tssc-dev-gitops
6
6
JENKINS_REPO=https://github.com/$MY_GITHUB_USER /tssc-dev-gitops-jenkins
7
7
8
+ DEFAULT_INIT_IMAGES=(
9
+ ' quay.io/redhat-appstudio/dance-bootstrap-app:latest'
10
+ ' registry.redhat.io/ubi9/httpd-24:latest'
11
+ )
12
+
8
13
WORK=$( mktemp -d)
9
14
10
15
GH_LOCAL=$WORK /gh-gitops
@@ -34,11 +39,20 @@ function promoteIfUpdated() {
34
39
DEFAULT_INIT_IMAGE=" quay.io/redhat-appstudio/dance-bootstrap-app:latest"
35
40
if [[ " ${! PREV_IMAGE_ENV_NAME} " != " $CURRENT_IMAGE " ]]; then
36
41
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
40
53
bash $SCRIPTDIR /rhtap-promote --repo $REPO
41
54
fi
55
+
42
56
eval " $PREV_IMAGE_ENV_NAME " =" $CURRENT_IMAGE "
43
57
fi
44
58
}
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
3
3
# gather-deploy-images
4
4
source $SCRIPTDIR /common.sh
5
5
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
+ )
7
10
8
11
function get-images-per-env() {
9
12
echo " Running $TASK_NAME :get-images-per-env"
@@ -23,11 +26,12 @@ function get-images-per-env() {
23
26
yaml_path=components/${component_name} /overlays/${env} /deployment-patch.yaml
24
27
image=$( yq " $IMAGE_PATH " " $yaml_path " )
25
28
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
31
35
32
36
if [ -n " $TARGET_BRANCH " ]; then
33
37
prev_image=$( git show " origin/$TARGET_BRANCH :$yaml_path " | yq " $IMAGE_PATH " )
You can’t perform that action at this time.
0 commit comments