@@ -10,26 +10,31 @@ UI_ENVIRONMENT := ui-e2e-tests
1010SSO_USERNAME_READ := $(shell if [ -n "$(CI ) " ]; then cat /usr/local/sandbox-secrets/SSO_USERNAME 2>/dev/null || echo ""; else echo "${SSO_USERNAME}"; fi)
1111SSO_PASSWORD_READ := $(shell if [ -n "$(CI ) " ]; then cat /usr/local/sandbox-secrets/SSO_PASSWORD 2>/dev/null || echo ""; else echo "${SSO_PASSWORD}"; fi)
1212
13- TAG := $(shell \
13+ QUAY_NAMESPACE ?= codeready-toolchain-test
14+ IMAGE_NAME_TO_PUSH_IN_QUAY ?= quay.io/$(QUAY_NAMESPACE ) /sandbox-rhdh-plugin
15+
16+ IMAGE_TO_PUSH_IN_QUAY := $(shell \
1417 if [ -n "$(CI )$(CLONEREFS_OPTIONS ) " ]; then \
1518 if [ -n "$(GITHUB_ACTIONS ) " ]; then \
1619 REPOSITORY_NAME=$$(basename "$(GITHUB_REPOSITORY ) ") ; \
1720 COMMIT_ID_SUFFIX=$$(echo "$(PULL_PULL_SHA ) " | cut -c1-7 ) ; \
18- echo "from.$${REPOSITORY_NAME}.PR$(PULL_NUMBER ) .$${COMMIT_ID_SUFFIX}"; \
21+ echo "$( IMAGE_NAME_TO_PUSH_IN_QUAY ) : from.$${REPOSITORY_NAME}.PR$(PULL_NUMBER ) .$${COMMIT_ID_SUFFIX}"; \
1922 else \
20- AUTHOR=$$(jq -r '.refs[0].pulls[0].author' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]' ) ; \
21- PULL_PULL_SHA=$${PULL_PULL_SHA:-$$(jq -r '.refs[0].pulls[0].sha' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]' ) }; \
22- COMMIT_ID_SUFFIX=$$(echo "$${PULL_PULL_SHA}" | cut -c1-7 ) ; \
23- echo "from.$(REPO_NAME ) .PR$(PULL_NUMBER ) .$${COMMIT_ID_SUFFIX}"; \
23+ : "if REPO_NAME is not set, it means that the E2E tests were triggered by periodic CI job"; \
24+ if [ -z "$(REPO_NAME ) " ]; then \
25+ echo "quay.io/codeready-toolchain/sandbox-rhdh-plugin:latest"; \
26+ else \
27+ AUTHOR=$$(jq -r '.refs[0].pulls[0].author' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]' ) ; \
28+ PULL_PULL_SHA=$${PULL_PULL_SHA:-$$(jq -r '.refs[0].pulls[0].sha' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]' ) }; \
29+ COMMIT_ID_SUFFIX=$$(echo "$${PULL_PULL_SHA}" | cut -c1-7 ) ; \
30+ echo "$(IMAGE_NAME_TO_PUSH_IN_QUAY ) :from.$$(echo $(REPO_NAME ) | sed 's/\"//g' ) .PR$(PULL_NUMBER ) .$${COMMIT_ID_SUFFIX}"; \
31+ fi; \
2432 fi; \
2533 else \
26- echo "latest"; \
34+ echo "$( IMAGE_NAME_TO_PUSH_IN_QUAY ) : latest"; \
2735 fi)
2836
2937
30- IMAGE_TO_PUSH_IN_QUAY ?= quay.io/$(QUAY_NAMESPACE ) /sandbox-rhdh-plugin:$(TAG )
31-
32-
3338.PHONY : deploy-sandbox-ui
3439deploy-sandbox-ui : HOST_NS=$(shell oc get projects -l app=host-operator --output=name -o jsonpath='{range .items[* ]}{.metadata.name}{"\n"}{end}' | sort | tail -n 1)
3540deploy-sandbox-ui : REGISTRATION_SERVICE_API=https://$(shell oc get route registration-service -n ${HOST_NS} -o custom-columns=":spec.host" | tr -d '\n') /api/v1
@@ -197,7 +202,7 @@ test-ui-e2e:
197202
198203.PHONY : test-ui-e2e-local
199204test-ui-e2e-local :
200- $(MAKE ) deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_TMP=${PWD} /../rhdh-plugins ENVIRONMENT=${UI_ENVIRONMENT}
205+ $(MAKE ) deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_TMP=${PWD} /../rhdh-plugins ENVIRONMENT=${UI_ENVIRONMENT} PUSH_SANDBOX_IMAGE=true
201206
202207
203208UNIT_TEST_IMAGE_NAME =sandbox-ui-e2e-tests
0 commit comments