Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#345 from rabi/shell_export
Browse files Browse the repository at this point in the history
Pass make variables to $(shell) environment
  • Loading branch information
openshift-merge-robot authored Jun 12, 2023
2 parents daf8c98 + cdf9f97 commit 949bf2f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,14 @@ OPM = $(shell which opm)
endif
endif

# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0).
# These images MUST exist in a registry and be pull-able.
BUNDLE_IMGS ?= $(BUNDLE_IMG)
# Build make variables to export for shell
MAKE_ENV := $(shell echo '$(.VARIABLES)' | awk -v RS=' ' '/^(IMAGE)|.*?(REGISTRY)$$/')
SHELL_EXPORT = $(foreach v,$(MAKE_ENV),$(v)='$($(v))')

.PHONY: catalog-prep
catalog-prep:
BUNDLE_IMGS = "$(BUNDLE_IMG)$(shell /bin/bash hack/pin-bundle-images.sh)"
# These images MUST exist in a registry and be pull-able.
BUNDLE_IMGS = "$(BUNDLE_IMG)$(shell $(SHELL_EXPORT) /bin/bash hack/pin-bundle-images.sh)"

# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
CATALOG_IMG ?= $(IMAGE_TAG_BASE)-index:v$(VERSION)
Expand Down

0 comments on commit 949bf2f

Please sign in to comment.