Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@

# Image URL to use all building/pushing image targets
IMG ?= quay.io/konveyor/oadp-non-admin:latest

SED = sed
# if on macos, install gsed
# https://formulae.brew.sh/formula/gnu-sed

# Codecov OS String for use in download url
ifeq ($(OS),Windows_NT)
OS_String = windows

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS_String is used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was used for codecov in oadp
https://github.com/openshift/oadp-operator/blob/14827fa839dce3ef68dbe63970588dfcf66d1aca/Makefile#L355
No not used here yet. Could be used later.

else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS_String = linux
endif
ifeq ($(UNAME_S),Darwin)
OS_String = macos
SED = gsed
endif
endif

# Kubernetes version from OpenShift 4.16.x https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/#4-stable
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29
Expand Down Expand Up @@ -109,7 +128,7 @@ PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
$(SED) -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
$(CONTAINER_TOOL) buildx use project-v3-builder
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
Expand Down Expand Up @@ -199,7 +218,7 @@ set -e; \
package=$(2)@$(3) ;\
echo "Downloading $${package}" ;\
GOBIN=$(LOCALBIN) go install $${package} ;\
mv "$$(echo "$(1)" | sed "s/-$(3)$$//")" $(1) ;\
mv "$$(echo "$(1)" | $(SED) "s/-$(3)$$//")" $(1) ;\
}
endef

Expand Down Expand Up @@ -287,10 +306,10 @@ endif
@{ \
NAC_VELERO_VERSION=$(shell grep -I 'github.com/openshift/velero' $(shell pwd)/go.mod | awk -F' ' '{print $$5}') ;\
OADP_VELERO_VERSION=$(shell grep -I 'github.com/openshift/velero' $(OADP_OPERATOR_PATH)/go.mod | awk -F' ' '{print $$5}') ;\
sed -i "s%$$NAC_VELERO_VERSION%$$OADP_VELERO_VERSION%" $(shell pwd)/go.mod ;\
$(SED) -i "s%$$NAC_VELERO_VERSION%$$OADP_VELERO_VERSION%" $(shell pwd)/go.mod ;\
for file_name in $(shell ls $(shell pwd)/hack/extra-crds);do \
cp $(OADP_OPERATOR_PATH)/config/crd/bases/$$file_name $(shell pwd)/hack/extra-crds/$$file_name && \
sed -i "1s%^%# Code generated by make update-velero-manifests. DO NOT EDIT.\n%" $(shell pwd)/hack/extra-crds/$$file_name;done ;\
$(SED) -i "1s%^%# Code generated by make update-velero-manifests. DO NOT EDIT.\n%" $(shell pwd)/hack/extra-crds/$$file_name;done ;\¸
}

.PHONY: docker-buildx-nac
Expand Down
Loading