diff --git a/Makefile b/Makefile index 7c7fd1e2e..f69eb4752 100644 --- a/Makefile +++ b/Makefile @@ -119,8 +119,15 @@ func-test: check-env: @./scripts/check-env.sh +# +# commitlint will do a rebase on top of GIT_SINCE when REBASE=1 is passed. +# +# Usage: make commitlint REBASE=1 +# +commitlint: REBASE ?= 0 commitlint: git fetch -v $(shell cut -d/ -f1 <<< "$(GIT_SINCE)") $(shell cut -d/ -f2- <<< "$(GIT_SINCE)") + @test $(REBASE) -eq 0 || git -c user.name=commitlint -c user.email=commitline@localhost rebase $(GIT_SINCE) commitlint --from FETCH_HEAD .PHONY: cephcsi @@ -157,8 +164,9 @@ containerized-build: .container-cmd .devel-container-id $(CONTAINER_CMD) run --rm -v $(CURDIR):/go/src/github.com/ceph/ceph-csi$(SELINUX_VOL_FLAG) $(CSI_IMAGE_NAME):devel make $(TARGET) containerized-test: TARGET = test +containerized-test: REBASE ?= 0 containerized-test: .container-cmd .test-container-id - $(CONTAINER_CMD) run --rm -v $(CURDIR):/go/src/github.com/ceph/ceph-csi$(SELINUX_VOL_FLAG) $(CSI_IMAGE_NAME):test make $(TARGET) GIT_SINCE=$(GIT_SINCE) + $(CONTAINER_CMD) run --rm -v $(CURDIR):/go/src/github.com/ceph/ceph-csi$(SELINUX_VOL_FLAG) $(CSI_IMAGE_NAME):test make $(TARGET) GIT_SINCE=$(GIT_SINCE) REBASE=$(REBASE) # create a (cached) container image with dependencied for building cephcsi .devel-container-id: .container-cmd scripts/Dockerfile.devel