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
2
.github/workflows/build-docker.yml
vendored
2
.github/workflows/build-docker.yml
vendored
|
|
@ -35,7 +35,7 @@ jobs:
|
||||||
password: ${{ secrets.DOCKERIO_PASSWORD }}
|
password: ${{ secrets.DOCKERIO_PASSWORD }}
|
||||||
- name: Build the Docker image
|
- name: Build the Docker image
|
||||||
# build both tags at the same time
|
# build both tags at the same time
|
||||||
run: make docker DOCKER_TAG="docker.io/ocrd/eynollah -t ghcr.io/qurator-spk/eynollah"
|
run: make docker DOCKER_TAG="docker.io/ocrd/eynollah ghcr.io/qurator-spk/eynollah"
|
||||||
- name: Test the Docker image
|
- name: Test the Docker image
|
||||||
run: docker run --rm ocrd/eynollah ocrd-eynollah-segment -h
|
run: docker run --rm ocrd/eynollah ocrd-eynollah-segment -h
|
||||||
- name: Push to Dockerhub
|
- name: Push to Dockerhub
|
||||||
|
|
|
||||||
12
Makefile
12
Makefile
|
|
@ -2,8 +2,7 @@ PYTHON ?= python3
|
||||||
PIP ?= pip3
|
PIP ?= pip3
|
||||||
EXTRAS ?=
|
EXTRAS ?=
|
||||||
|
|
||||||
# DOCKER_BASE_IMAGE = artefakt.dev.sbb.berlin:5000/sbb/ocrd_core:v2.68.0
|
DOCKER_BASE_IMAGE ?= docker.io/ocrd/core-cuda-tf2:3.12.2
|
||||||
DOCKER_BASE_IMAGE ?= docker.io/ocrd/core-cuda-tf2:latest
|
|
||||||
DOCKER_TAG ?= ocrd/eynollah
|
DOCKER_TAG ?= ocrd/eynollah
|
||||||
DOCKER ?= docker
|
DOCKER ?= docker
|
||||||
WGET = wget -O
|
WGET = wget -O
|
||||||
|
|
@ -120,12 +119,19 @@ coverage:
|
||||||
$(MAKE) test PYTHON="coverage run"
|
$(MAKE) test PYTHON="coverage run"
|
||||||
coverage report -m
|
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
|
# Build docker image
|
||||||
docker:
|
docker:
|
||||||
$(DOCKER) build \
|
$(DOCKER) build \
|
||||||
--build-arg DOCKER_BASE_IMAGE=$(DOCKER_BASE_IMAGE) \
|
--build-arg DOCKER_BASE_IMAGE=$(DOCKER_BASE_IMAGE) \
|
||||||
--build-arg VCS_REF=$$(git rev-parse --short HEAD) \
|
--build-arg VCS_REF=$$(git rev-parse --short HEAD) \
|
||||||
--build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
--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
|
.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