Commit d174c2d8 authored by Luiz Costa's avatar Luiz Costa

Merge branch '0.11.x'

parents 4622afbd e594f0f1
......@@ -4,8 +4,8 @@ LABEL maintainer="luiz@thenets.org"
ENV PARSOID_HOME=/var/lib/parsoid \
PARSOID_USER=parsoid \
# PARSOID_VERSION [v0.8.1, v0.9.0, v0.10.0, master]
PARSOID_VERSION=master
# PARSOID_VERSION [v0.8.1, v0.9.0, v0.10.0, v0.11.0, master]
PARSOID_VERSION=v0.11.0
COPY run-parsoid.sh /run-parsoid.sh
......
......@@ -11,6 +11,9 @@ post-build:
docker-build:
docker build -t $(NAME):$(TAG) --rm .
docker-build-ubuntu:
docker build -f ubuntu.dockerfile -t $(NAME):$(TAG) --rm .
shell:
docker run -it --rm --entrypoint=$(SHELL) -p 8080:80 $(NAME):$(TAG)
......@@ -22,4 +25,5 @@ test:
docker run -it --rm -p 8080:8000 -e PARSOID_DOMAIN_localhost=http://localhost/w/api.php $(NAME):$(TAG)
unit-test:
docker run -it --rm -w "/var/lib/parsoid" $(NAME):$(TAG) npm test
\ No newline at end of file
chmod +x run-unit-tests.sh
./run-unit-tests.sh $(NAME):$(TAG)
\ No newline at end of file
#!/bin/bash
if [[ -z $1 ]]; then
echo "[ERROR] Missing the image tag as arg!" >/dev/stderr
echo "How to use: ./run-unit-tests.sh thenets/parsoid:0.11"
exit 1
fi
set -x
DOCKER_IMAGE=$1
TEMP_DIR=$(mktemp -d)
docker run -it --rm \
-w "/var/lib/parsoid" \
-v ${TEMP_DIR}/npm_logs:/root/.npm/_logs/ \
${DOCKER_IMAGE} \
npm test
set +x
echo ""
echo "[DONE] Log files at: ${TEMP_DIR}"
FROM node:13
LABEL maintainer="luiz@thenets.org"
ENV PARSOID_HOME=/var/lib/parsoid \
PARSOID_USER=parsoid \
# PARSOID_VERSION [v0.8.1, v0.9.0, v0.10.0, v0.11.0, master]
PARSOID_VERSION=v0.11.0
COPY run-parsoid.sh /run-parsoid.sh
# Parsoid setup
RUN set -x \
# Install required packages
&& apt-get update \
&& apt-get install -y python git tar bash make
RUN set -x \
# Add user
&& useradd -M -u 1001 -s /bin/bash ${PARSOID_USER} \
# Set permissions
&& chmod -v +x /run-parsoid.sh \
# Core
&& mkdir -p ${PARSOID_HOME} \
&& git clone \
--branch ${PARSOID_VERSION} \
--single-branch \
--depth 1 \
--quiet \
https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid \
${PARSOID_HOME}
RUN set -x \
&& cd ${PARSOID_HOME} \
&& npm install
EXPOSE 8000
EXPOSE 8001
CMD ["/run-parsoid.sh"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment