Skip to content
Snippets Groups Projects
Unverified Commit a912b210 authored by Sebastian Höffner's avatar Sebastian Höffner
Browse files

Building using customizable OpenCCG version.

parent 7094a918
No related branches found
No related tags found
No related merge requests found
......@@ -5,18 +5,28 @@ LABEL description="A small webapp to parse sentences using the DiaSpace grammar
LABEL version="2.1"
ARG GRAMMAR_VERSION=master
ARG OPENCCG_VERSION=0.9.5
ARG OPENCCG_LIB_VERSION=0.9.5
ARG OPENCCG_REPOSITORY=https://github.com/OpenCCG/openccg
ARG OPENCCG_VERSION=master
ARG WCCG_POOL_SIZE=3
EXPOSE 5000 8080
ENV OPENCCG_HOME /openccg
ENV PATH "$OPENCCG_HOME/bin:$PATH"
ENV LD_LIBRARY_PATH "$OPENCCG_HOME/lib:$LD_LIBRARY_PATH"
# Download and extract OpenCCG
RUN curl -o openccg-${OPENCCG_VERSION}.tgz https://datapacket.dl.sourceforge.net/project/openccg/openccg/openccg%20v${OPENCCG_VERSION}%20-%20deplen%2C%20kenlm%2C%20disjunctivizer/openccg-${OPENCCG_VERSION}.tgz \
&& tar zxf openccg-${OPENCCG_VERSION}.tgz \
&& rm openccg-${OPENCCG_VERSION}.tgz \
ENV PATH "${OPENCCG_HOME}/bin:$PATH"
ENV LD_LIBRARY_PATH "${OPENCCG_HOME}/lib:${LD_LIBRARY_PATH}"
ENV WCCG_POOL_SIZE=${WCCG_POOL_SIZE}
# Download and extract OpenCCG -- first for libraries, then the requested source-code version
RUN curl -o openccg-${OPENCCG_LIB_VERSION}.tgz https://datapacket.dl.sourceforge.net/project/openccg/openccg/openccg%20v${OPENCCG_LIB_VERSION}%20-%20deplen%2C%20kenlm%2C%20disjunctivizer/openccg-${OPENCCG_LIB_VERSION}.tgz \
&& tar zxf openccg-${OPENCCG_LIB_VERSION}.tgz \
&& rm openccg-${OPENCCG_LIB_VERSION}.tgz \
# Source code overwrites
&& curl -o openccg.zip -L ${OPENCCG_REPOSITORY}/archive/${OPENCCG_VERSION}.zip \
&& unzip openccg.zip \
&& rm openccg.zip \
&& cp -r openccg-*/* /openccg/ \
&& rm -r openccg-* \
# Download and extract grammar
&& curl -o grammar.zip -L https://github.com/shoeffner/openccg-gum-cooking/archive/${GRAMMAR_VERSION}.zip \
&& unzip -d /tmp grammar.zip \
......
......@@ -4,7 +4,7 @@ pipeline {
stages {
stage('build') {
steps {
sh 'docker build . --no-cache --build-arg GRAMMAR_VERSION=legacy/grammar -t web-openccg:$(git rev-parse --short HEAD)'
sh 'docker build . --no-cache --build-arg OPENCCG_REPOSITORY=https://github.com/shoeffner/openccg --build-arg OPENCCG_VERSION=feature/wccg-prompt --build-arg GRAMMAR_VERSION=legacy/grammar -t web-openccg:$(git rev-parse --short HEAD)'
}
}
......
......@@ -5,7 +5,11 @@ webopenccg/generated_openccg_parser.py: OpenCCG.ebnf
.PHONY: build
build:
docker build . --build-arg GRAMMAR_VERSION=legacy/grammar -t web-openccg
docker build . \
--build-arg OPENCCG_REPOSITORY=https://github.com/shoeffner/openccg \
--build-arg OPENCCG_VERSION=feature/wccg-prompt \
--build-arg GRAMMAR_VERSION=legacy/grammar \
-t web-openccg
webopenccg/static/%.js:
docker run --rm --detach --name web-openccg-build-$(notdir $@) web-openccg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment