@@ -24,6 +24,15 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
2424endif
2525BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS ) $(BUNDLE_DEFAULT_CHANNEL )
2626
27+ # Load the environment variables from the .env file
28+ # This is useful for local development and testing.
29+ # You can also set the environment variables directly in the CI/CD pipeline.
30+ # To use the .env file, you can create a .env file in the root of the project and define the variables.
31+ ifneq (,$(wildcard ./.env) )
32+ include .env
33+ endif
34+
35+
2736# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
2837# This variable is used to construct full image tags for bundle and catalog images.
2938#
@@ -35,6 +44,7 @@ IMAGE_NAMESPACE ?= openshift-console
3544IMAGE_REPO ?= $(IMAGE_HOST ) /$(IMAGE_NAMESPACE )
3645IMAGE_TAG_BASE ?= $(IMAGE_REPO ) /console-application-operator
3746
47+
3848# TAG allows the tag for the operator image to be changed. Defaults to the VERSION
3949TAG ?= $(VERSION )
4050
@@ -169,8 +179,14 @@ run: manifests generate fmt vet ## Run a controller from your host.
169179container-build : test ko # # Build the container image with the operator.
170180 KO_DOCKER_REPO=${IMAGE_REPO} $(KO ) build . --push=false ${KO_OPTS}
171181
182+ .PHONY : print-auth
183+ print-auth : # # Print the environment variables.
184+ @echo " Username: ${QUAY_USER_NAME} "
185+ @echo " Password: ${QUAY_AUTH_TOKEN} "
186+
172187.PHONY : container-push
173188container-push : # # Push the container image with the operator.
189+ echo " ${QUAY_AUTH_TOKEN} " | ko login quay.io --username ${QUAY_USER_NAME} --password-stdin
174190 KO_DOCKER_REPO=${IMAGE_REPO} $(KO ) build . ${KO_OPTS}
175191
176192# If you wish to build the manager image targeting other platforms you can use the --platform flag.
0 commit comments