@@ -24,6 +24,15 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
24
24
endif
25
25
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS ) $(BUNDLE_DEFAULT_CHANNEL )
26
26
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
+
27
36
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
28
37
# This variable is used to construct full image tags for bundle and catalog images.
29
38
#
@@ -35,6 +44,7 @@ IMAGE_NAMESPACE ?= openshift-console
35
44
IMAGE_REPO ?= $(IMAGE_HOST ) /$(IMAGE_NAMESPACE )
36
45
IMAGE_TAG_BASE ?= $(IMAGE_REPO ) /console-application-operator
37
46
47
+
38
48
# TAG allows the tag for the operator image to be changed. Defaults to the VERSION
39
49
TAG ?= $(VERSION )
40
50
@@ -169,8 +179,14 @@ run: manifests generate fmt vet ## Run a controller from your host.
169
179
container-build : test ko # # Build the container image with the operator.
170
180
KO_DOCKER_REPO=${IMAGE_REPO} $(KO ) build . --push=false ${KO_OPTS}
171
181
182
+ .PHONY : print-auth
183
+ print-auth : # # Print the environment variables.
184
+ @echo " Username: ${QUAY_USER_NAME} "
185
+ @echo " Password: ${QUAY_AUTH_TOKEN} "
186
+
172
187
.PHONY : container-push
173
188
container-push : # # Push the container image with the operator.
189
+ echo " ${QUAY_AUTH_TOKEN} " | ko login quay.io --username ${QUAY_USER_NAME} --password-stdin
174
190
KO_DOCKER_REPO=${IMAGE_REPO} $(KO ) build . ${KO_OPTS}
175
191
176
192
# If you wish to build the manager image targeting other platforms you can use the --platform flag.
0 commit comments