mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-01 03:32:00 +02:00
ci: tag eynollah docker image with git tag version if possible, else latest
This commit is contained in:
parent
bb092364af
commit
f58189d5f4
2 changed files with 10 additions and 4 deletions
12
Makefile
12
Makefile
|
|
@ -2,8 +2,7 @@ PYTHON ?= python3
|
|||
PIP ?= pip3
|
||||
EXTRAS ?=
|
||||
|
||||
# DOCKER_BASE_IMAGE = artefakt.dev.sbb.berlin:5000/sbb/ocrd_core:v2.68.0
|
||||
DOCKER_BASE_IMAGE ?= docker.io/ocrd/core-cuda-tf2:latest
|
||||
DOCKER_BASE_IMAGE ?= docker.io/ocrd/core-cuda-tf2:3.12.2
|
||||
DOCKER_TAG ?= ocrd/eynollah
|
||||
DOCKER ?= docker
|
||||
WGET = wget -O
|
||||
|
|
@ -120,12 +119,19 @@ coverage:
|
|||
$(MAKE) test PYTHON="coverage run"
|
||||
coverage report -m
|
||||
|
||||
# Concatenate docker image names with either the git tag describing current commit or 'latest' and
|
||||
# merge list with "-t"
|
||||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
GIT_TAG := $(strip $(shell git describe --tags | grep -x "v[0-9]\+\.[0-9]\+\.[0-9]\+"))
|
||||
DOCKER_TAGS = $(subst $(space),$(space)-t$(space),$(DOCKER_TAG:%=$(if $(GIT_TAG),%:$(GIT_TAG),%:latest)))
|
||||
|
||||
# Build docker image
|
||||
docker:
|
||||
$(DOCKER) build \
|
||||
--build-arg DOCKER_BASE_IMAGE=$(DOCKER_BASE_IMAGE) \
|
||||
--build-arg VCS_REF=$$(git rev-parse --short HEAD) \
|
||||
--build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||
-t $(DOCKER_TAG) .
|
||||
-t $(DOCKER_TAGS) .
|
||||
|
||||
.PHONY: models build install install-dev test smoke-test ocrd-test coverage docker help
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue