Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feso/6.3 #60

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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