Skip to content

Commit

Permalink
Merge pull request #60 from silvio/feso/6.3
Browse files Browse the repository at this point in the history
Feso/6.3
  • Loading branch information
silvio authored Dec 18, 2023
2 parents 2c9c473 + 90d560a commit c8173a5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ FROM docker.io/library/eclipse-temurin:19

# see Makefile.version
ARG VERSION
ARG UNPACKED_VERSION

LABEL maintainer="Silvio Fricke <[email protected]>"

RUN curl --remote-name https://languagetool.org/download/LanguageTool-"$VERSION".zip && \
jar xvf ./LanguageTool-"$VERSION".zip && \
rm LanguageTool-"$VERSION".zip
ADD ./LanguageTool-"${UNPACKED_VERSION}" /LanguageTool-"${UNPACKED_VERSION}"

WORKDIR /LanguageTool-"$VERSION"
WORKDIR /LanguageTool-"${UNPACKED_VERSION}"

COPY misc/start.sh .
CMD [ "sh", "start.sh" ]
Expand Down
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,38 @@ include Makefile.version

envout:
@echo "VERSION=$(VERSION)"
@echo "UNPACKED_VERSION=$(UNPACKED_VERSION)"
@echo "BUILDARG_VERSION=$(BUILDARG_VERSION)"
@echo "IMAGENAME=$(IMAGENAME)"
@echo "BUILDARG_PLATFORM=$(BUILDARG_PLATFORM)"

prepare:
sudo apt-get -qq -y install curl

build:
build: download
docker buildx build $(BUILDARG_VERSION) $(BUILDARG_PLATFORM) -t $(IMAGENAME):latest .
docker buildx build $(BUILDARG_VERSION) --load -t $(IMAGENAME):latest .

download: LanguageTool-$(VERSION).zip
-rm -rf LanguageTool-$(VERSION) LanguageTool-$(UNPACKED_VERSION)
echo ":: unzipping LanguageTool-$(VERSION).zip"
unzip -o LanguageTool-$(VERSION).zip 2>&1 1>/dev/null

LanguageTool-$(VERSION).zip:
curl -L https://www.languagetool.org/download/LanguageTool-$(VERSION).zip -o LanguageTool-$(VERSION).zip

test: test-cleanup.1
test: test-start
test: TESTIPADDRESS=$(subst ",,$(shell docker inspect languagetool | jq '.[0].NetworkSettings.IPAddress'))
test: test-print-ip-address
test: test-start
test: test-run-test-lang
test: test-run-test-en
test: test-run-test-fr
test: test-cleanup.2

test-start:
docker run -d --name languagetool -p 8010:8010 $(IMAGENAME):latest
sleep 3
sleep 6

test-print-ip-address:
@echo "IP address of languagetools docker container: $(TESTIPADDRESS)"
Expand Down Expand Up @@ -54,8 +63,8 @@ test-run-test-fr:

.PHONY: test-cleanup
test-cleanup.%:
-docker stop languagetool
-docker rm languagetool
-docker container stop languagetool
-docker container rm languagetool

.PHONY: tag
tag: tag-push
Expand Down
5 changes: 3 additions & 2 deletions Makefile.version
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
VERSION := 6.3
BUILDARG_VERSION := --build-arg VERSION=$(VERSION)
VERSION := 6.3a
UNPACKED_VERSION := $(shell echo $(VERSION) | sed -e 's/\([0-9]\+\.[0-9]\+\)\(.*\)/\1/')
BUILDARG_VERSION := --build-arg VERSION=$(VERSION) --build-arg UNPACKED_VERSION=$(UNPACKED_VERSION)
IMAGENAME := docker.io/silviof/docker-languagetool
BUILDARG_PLATFORM := --platform linux/amd64,linux/arm64/v8,linux/arm/v7

0 comments on commit c8173a5

Please sign in to comment.