5
5
6
6
# INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:394248
7
7
INDEX_IMAGES ?=
8
- INDEX_OPTIONS =$(shell echo $(INDEX_IMAGES ) | tr ',' '\n' | awk -F: 'match($$1,"/") {print "--set main.extraParameters."NR".name=clusterGroup.indexImages."NR".image --set main.extraParameters."NR".value="$$1":"$$2}')
9
8
10
9
TARGET_ORIGIN ?= origin
11
10
# This is to ensure that whether we start with a git@ or https:// URL, we end up with an https:// URL
@@ -15,7 +14,7 @@ TARGET_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN) | sed -e '
15
14
TARGET_BRANCH =$(shell git rev-parse --abbrev-ref HEAD)
16
15
17
16
# --set values always take precedence over the contents of -f
18
- HELM_OPTS =-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO ) " --set main.git.revision=$(TARGET_BRANCH ) $(TARGET_SITE_OPT ) $( INDEX_OPTIONS )
17
+ HELM_OPTS =-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO ) " --set main.git.revision=$(TARGET_BRANCH ) $(TARGET_SITE_OPT )
19
18
20
19
# #@ Pattern Common Tasks
21
20
@@ -35,7 +34,7 @@ show: ## show the starting template without installing it
35
34
# warnings when the chart gets applied the first time, but the resources were
36
35
# created first via the VP operator's UI
37
36
.PHONY : operator-deploy
38
- operator-deploy operator-upgrade : validate-prereq validate-origin # # runs helm install
37
+ operator-deploy operator-upgrade : validate-prereq validate-origin load-iibs # # runs helm install
39
38
@set -e; if ! oc get crds patterns.gitops.hybrid-cloud-patterns.io > /dev/null 2>&1 ; then \
40
39
echo " Running helm:" ; \
41
40
helm upgrade --install $(NAME ) common/operator-install/ $(HELM_OPTS ) ; \
@@ -55,6 +54,24 @@ uninstall: ## runs helm uninstall
55
54
load-secrets : # # loads the secrets into the vault
56
55
common/scripts/vault-utils.sh push_secrets $(NAME )
57
56
57
+ b.PHONY : load-iibs
58
+ load-iibs :
59
+ set -e; if [ x$( INDEX_IMAGES) != x ]; then \
60
+ oc patch image.config.openshift.io/cluster --patch ' {"spec":{"registrySources":{"insecureRegistries":["registry-proxy-stage.engineering.redhat.com", "registry-proxy.engineering.redhat.com"]}}}' --type=merge; \
61
+ for iib in $( shell echo $( INDEX_IMAGES) | tr ' ,' ' \n' ) ; do \
62
+ echo " Processing $$ iib" \
63
+ export iibnum=$$(echo $$iib | sed 's/.*://' ) ; \
64
+ export iibdir=$$(echo $$PWD/manifests-iib-* ) ; \
65
+ rm -rf $$ iibdir; \
66
+ oc adm catalog mirror --manifests-only $$ iib $$(dirname $$iib ) --insecure; \
67
+ sed -i " s/name: iib/name: iib-$$ iibnum/" $$ PWD/manifests-iib-* /catalogSource.yaml ; \
68
+ echo " Applying $$ iib manifests" \
69
+ oc apply -f $$ iibdir/imageContentSourcePolicy.yaml ; \
70
+ oc apply -f $$ iibdir/catalogSource.yaml ; \
71
+ done ; \
72
+ fi
73
+
74
+
58
75
# #@ Validation Tasks
59
76
60
77
# We only check the remote ssh git branch's existance if we're not running inside a container
0 commit comments