Skip to content

Commit

Permalink
makefile: allow testing with unreleased quincy containers
Browse files Browse the repository at this point in the history
Signed-off-by: John Mulligan <[email protected]>
  • Loading branch information
phlogistonjohn authored and mergify[bot] committed May 2, 2022
1 parent 13bdb3e commit 37ba163
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ endif
ifeq ($(CEPH_VERSION),quincy)
CEPH_TAG := v17
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
GOFMT_CMD:=gofmt
Expand Down Expand Up @@ -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)
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:
$(GO_CMD) build -v -tags $(BUILD_TAGS) $(shell $(GO_CMD) list ./... | grep -v /contrib)
fmt:
Expand Down Expand Up @@ -172,8 +194,7 @@ endif
ci-image: $(BUILDFILE)
$(BUILDFILE): $(CONTAINER_CONFIG_DIR)/Dockerfile entrypoint.sh micro-osd.sh
$(CONTAINER_CMD) build \
--build-arg GO_CEPH_VERSION=$(CEPH_VERSION) \
--build-arg CEPH_TAG=$(CEPH_TAG) \
$(CONTAINER_BUILD_ARGS) \
$(CONTAINER_BUILD_OPTS) \
-t $(CI_IMAGE_TAG) \
-f $(CONTAINER_CONFIG_DIR)/Dockerfile .
Expand Down

0 comments on commit 37ba163

Please sign in to comment.