88# the command line. I.e. we can set things without having to tweak values files
99EXTRA_HELM_OPTS ?=
1010
11+ # This variable can be set in order to pass additional ansible-playbook arguments from the
12+ # the command line. I.e. we can set -vvv for more verbose logging
13+ EXTRA_PLAYBOOK_OPTS ?=
14+
1115# INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:394248
1216# or
1317# INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:394248,registry-proxy.engineering.redhat.com/rh-osbs/iib:394249
@@ -18,7 +22,7 @@ TARGET_ORIGIN ?= origin
1822# This is because we expect to use tokens for repo authentication as opposed to SSH keys
1923TARGET_REPO =$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN ) | sed -e 's/.* URL:[[:space:]]* //' -e 's% ^git@%% ' -e 's% ^https://%% ' -e 's% :% /% ' -e 's% ^% https://% ')
2024# git branch --show-current is also available as of git 2.22, but we will use this for compatibility
21- TARGET_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
25+ TARGET_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
2226
2327UUID_FILE ?= ~/.config/validated-patterns/pattern-uuid
2428UUID_HELM_OPTS ?=
@@ -111,7 +115,7 @@ secrets-backend-none: ## Edits values files to remove secrets manager + ESO
111115.PHONY : load-iib
112116load-iib : # # CI target to install Index Image Bundles
113117 @set -e; if [ x$( INDEX_IMAGES) != x ]; then \
114- ansible-playbook rhvp.cluster_utils.iib_ci; \
118+ ansible-playbook $( EXTRA_PLAYBOOK_OPTS ) rhvp.cluster_utils.iib_ci; \
115119 else \
116120 echo " No INDEX_IMAGES defined. Bailing out" ; \
117121 exit 1; \
@@ -159,15 +163,20 @@ validate-cluster: ## Do some cluster validations before installing
159163validate-schema : # # validates values files against schema in common/clustergroup
160164 $(eval VAL_PARAMS := $(shell for i in ./values-* .yaml; do echo -n "$${i} "; done) )
161165 @echo -n " Validating clustergroup schema of: "
162- @set -e; for i in $( VAL_PARAMS) ; do echo -n " $$ i" ; helm template common /clustergroup $( HELM_OPTS) -f " $$ {i}" > /dev/null; done
166+ @set -e; for i in $( VAL_PARAMS) ; do echo -n " $$ i" ; helm template oci://quay.io/hybridcloudpatterns /clustergroup $( HELM_OPTS) -f " $$ {i}" > /dev/null; done
163167 @echo
164168
165169.PHONY : validate-prereq
166170validate-prereq : # # verify pre-requisites
171+ $(eval GLOBAL_PATTERN := $(shell yq -r .global.pattern values-global.yaml) )
172+ @if [ $( NAME) != $( GLOBAL_PATTERN) ]; then\
173+ echo " " ; \
174+ echo " WARNING: folder directory is \" $( NAME) \" and global.pattern is set to \" $( GLOBAL_PATTERN) \" " ; \
175+ echo " this can create problems. Please make sure they are the same!" ; \
176+ echo " " ; \
177+ fi
167178 @if [ ! -f /run/.containerenv ]; then\
168179 echo " Checking prerequisites:" ; \
169- for t in $( EXECUTABLES) ; do if ! which $$ t > /dev/null 2>&1 ; then echo " No $$ t in PATH" ; exit 1; fi ; done ; \
170- echo " Check for '$( EXECUTABLES) ': OK" ; \
171180 echo -n " Check for python-kubernetes: " ; \
172181 if ! ansible -m ansible.builtin.command -a " {{ ansible_python_interpreter }} -c 'import kubernetes'" localhost > /dev/null 2>&1 ; then echo " Not found" ; exit 1; fi ; \
173182 echo " OK" ; \
@@ -188,16 +197,16 @@ validate-prereq: ## verify pre-requisites
188197.PHONY : argo-healthcheck
189198argo-healthcheck : # # Checks if all argo applications are synced
190199 @echo " Checking argo applications"
191- $(eval APPS := $(shell oc get applications -A -o jsonpath='{range .items[* ]}{@.metadata.namespace}{","}{@.metadata.name}{"\n"}{end}') )
200+ $(eval APPS := $(shell oc get applications.argoproj.io -A -o jsonpath='{range .items[* ]}{@.metadata.namespace}{","}{@.metadata.name}{"\n"}{end}') )
192201 @NOTOK=0; \
193202 for i in $( APPS) ; do\
194203 n=` echo " $$ {i}" | cut -f1 -d,` ; \
195204 a=` echo " $$ {i}" | cut -f2 -d,` ; \
196- STATUS=` oc get -n " $$ {n}" application /" $$ {a}" -o jsonpath=' {.status.sync.status}' ` ; \
205+ STATUS=` oc get -n " $$ {n}" applications.argoproj.io /" $$ {a}" -o jsonpath=' {.status.sync.status}' ` ; \
197206 if [[ $$ STATUS != " Synced" ]]; then\
198207 NOTOK=$$(( $${NOTOK} + 1 ) ); \
199208 fi ; \
200- HEALTH=` oc get -n " $$ {n}" application /" $$ {a}" -o jsonpath=' {.status.health.status}' ` ; \
209+ HEALTH=` oc get -n " $$ {n}" applications.argoproj.io /" $$ {a}" -o jsonpath=' {.status.health.status}' ` ; \
201210 if [[ $$ HEALTH != " Healthy" ]]; then\
202211 NOTOK=$$(( $${NOTOK} + 1 ) ); \
203212 fi ; \
@@ -214,7 +223,7 @@ argo-healthcheck: ## Checks if all argo applications are synced
214223.PHONY : qe-tests
215224qe-tests : # # Runs the tests that QE runs
216225 @set -e; if [ -f ./tests/interop/run_tests.sh ]; then \
217- ./tests/interop/run_tests.sh; \
226+ pushd ./tests/interop; . /run_tests.sh; popd ; \
218227 else \
219228 echo " No ./tests/interop/run_tests.sh found skipping" ; \
220229 fi
0 commit comments