makefile: allow testing with unreleased quincy containers

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2022-04-04 15:08:22 -04:00 committed by mergify[bot]
parent 13bdb3e26c
commit 37ba163aae
1 changed files with 23 additions and 2 deletions

View File

@ -29,6 +29,14 @@ endif
ifeq ($(CEPH_VERSION),quincy) ifeq ($(CEPH_VERSION),quincy)
CEPH_TAG := v17 CEPH_TAG := v17
endif endif
# ci-<codename> indicates we want to consume pre-release versions of ceph from
# the ceph ci. This way we can start testing on ceph versions before they hit
# quay.io/ceph/ceph
ifeq ($(CEPH_VERSION),ci-quincy)
CEPH_TAG := quincy
CEPH_IMG := quay.ceph.io/ceph-ci/ceph
GO_CEPH_VERSION := quincy
endif
GO_CMD:=go GO_CMD:=go
GOFMT_CMD:=gofmt GOFMT_CMD:=gofmt
@ -73,6 +81,20 @@ ifneq ($(USE_GOCO),)
GOFMT_CMD:=$(CONTAINER_CMD) run $(CONTAINER_OPTS) --rm $(GOCACHE_VOLUME) -v $(CURDIR):/go/src/github.com/ceph/go-ceph$(VOLUME_FLAGS) --entrypoint $(GOFMT_CMD) $(CI_IMAGE_TAG) GOFMT_CMD:=$(CONTAINER_CMD) run $(CONTAINER_OPTS) --rm $(GOCACHE_VOLUME) -v $(CURDIR):/go/src/github.com/ceph/go-ceph$(VOLUME_FLAGS) --entrypoint $(GOFMT_CMD) $(CI_IMAGE_TAG)
endif endif
# Assemble the various build args that will be passed container build command(s)
CONTAINER_BUILD_ARGS:=$(DEFAULT_BUILD_ARGS)
ifdef CEPH_IMG
CONTAINER_BUILD_ARGS += --build-arg CEPH_IMG=$(CEPH_IMG)
endif
ifdef CEPH_TAG
CONTAINER_BUILD_ARGS += --build-arg CEPH_TAG=$(CEPH_TAG)
endif
ifdef GO_CEPH_VERSION
CONTAINER_BUILD_ARGS += --build-arg GO_CEPH_VERSION=$(GO_CEPH_VERSION)
else
CONTAINER_BUILD_ARGS += --build-arg GO_CEPH_VERSION=$(CEPH_VERSION)
endif
build: build:
$(GO_CMD) build -v -tags $(BUILD_TAGS) $(shell $(GO_CMD) list ./... | grep -v /contrib) $(GO_CMD) build -v -tags $(BUILD_TAGS) $(shell $(GO_CMD) list ./... | grep -v /contrib)
fmt: fmt:
@ -172,8 +194,7 @@ endif
ci-image: $(BUILDFILE) ci-image: $(BUILDFILE)
$(BUILDFILE): $(CONTAINER_CONFIG_DIR)/Dockerfile entrypoint.sh micro-osd.sh $(BUILDFILE): $(CONTAINER_CONFIG_DIR)/Dockerfile entrypoint.sh micro-osd.sh
$(CONTAINER_CMD) build \ $(CONTAINER_CMD) build \
--build-arg GO_CEPH_VERSION=$(CEPH_VERSION) \ $(CONTAINER_BUILD_ARGS) \
--build-arg CEPH_TAG=$(CEPH_TAG) \
$(CONTAINER_BUILD_OPTS) \ $(CONTAINER_BUILD_OPTS) \
-t $(CI_IMAGE_TAG) \ -t $(CI_IMAGE_TAG) \
-f $(CONTAINER_CONFIG_DIR)/Dockerfile . -f $(CONTAINER_CONFIG_DIR)/Dockerfile .