Squashed '.ci/' changes from 63421d1..79eebe4
79eebe4 add ARCH support for tests aea1ccc Only add branch name to tags, if not part of actual tag a5875db Make EXTRA_TAGS work again git-subtree-dir: .ci git-subtree-split: 79eebe4d3de843d921994db20e20dda801272934
This commit is contained in:
parent
c0058943d7
commit
470ded099b
15
podman.mk
15
podman.mk
@ -2,17 +2,18 @@
|
|||||||
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||||
GIT_TAG := $(shell git describe --tags --match v*.*.* 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
|
GIT_TAG := $(shell git describe --tags --match v*.*.* 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
|
||||||
|
|
||||||
# append branch name to tag if NOT main nor master
|
|
||||||
TAG := $(GIT_TAG)
|
TAG := $(GIT_TAG)
|
||||||
|
# append branch name to tag if NOT main nor master
|
||||||
ifeq (,$(filter main master, $(GIT_BRANCH)))
|
ifeq (,$(filter main master, $(GIT_BRANCH)))
|
||||||
ifneq ($(GIT_TAG), $(GIT_BRANCH))
|
# If branch is substring of tag, omit branch name
|
||||||
TAG = $(GIT_TAG)-$(GIT_BRANCH)
|
ifeq ($(findstring $(GIT_BRANCH), $(GIT_TAG)),)
|
||||||
|
# only append branch name if not equal tag
|
||||||
|
ifneq ($(GIT_TAG), $(GIT_BRANCH))
|
||||||
|
TAG = $(GIT_TAG)-$(GIT_BRANCH)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# optionally set by the caller
|
|
||||||
EXTRA_TAGS :=
|
|
||||||
|
|
||||||
ARCH := amd64
|
ARCH := amd64
|
||||||
ALL_ARCHS := amd64 arm64
|
ALL_ARCHS := amd64 arm64
|
||||||
_ARCH = $(or $(filter $(ARCH),$(ALL_ARCHS)),$(error $$ARCH [$(ARCH)] must be exactly one of "$(ALL_ARCHS)"))
|
_ARCH = $(or $(filter $(ARCH),$(ALL_ARCHS)),$(error $$ARCH [$(ARCH)] must be exactly one of "$(ALL_ARCHS)"))
|
||||||
@ -36,7 +37,7 @@ build: ## Build the app
|
|||||||
|
|
||||||
test: rm-test-image ## Execute Dockerfile.test
|
test: rm-test-image ## Execute Dockerfile.test
|
||||||
test -f Dockerfile.test && \
|
test -f Dockerfile.test && \
|
||||||
{ buildah build --rm --layers -t $(REGISTRY)/$(IMAGE):$(TAG)-test --from=$(REGISTRY)/$(IMAGE):$(TAG) -f Dockerfile.test --platform linux/$(_ARCH) . && \
|
{ buildah build --rm --layers -t $(REGISTRY)/$(IMAGE):$(TAG)-$(_ARCH)-test --from=$(REGISTRY)/$(IMAGE):$(TAG) -f Dockerfile.test --platform linux/$(_ARCH) . && \
|
||||||
podman run --rm --env-host -t $(REGISTRY)/$(IMAGE):$(TAG)-$(_ARCH)-test; } || \
|
podman run --rm --env-host -t $(REGISTRY)/$(IMAGE):$(TAG)-$(_ARCH)-test; } || \
|
||||||
echo "No Dockerfile.test found, skipping test"
|
echo "No Dockerfile.test found, skipping test"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user