Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parsoid
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
docker
parsoid
Commits
e594f0f1
Commit
e594f0f1
authored
Mar 02, 2020
by
Luiz Costa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Ubuntu Dockerfile and new unit test script
parent
423cd26e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
1 deletion
+69
-1
Makefile
Makefile
+5
-1
run-unit-tests.sh
run-unit-tests.sh
+24
-0
ubuntu.dockerfile
ubuntu.dockerfile
+40
-0
No files found.
Makefile
View file @
e594f0f1
...
...
@@ -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
run-unit-tests.sh
0 → 100755
View file @
e594f0f1
#!/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
}
"
ubuntu.dockerfile
0 → 100644
View file @
e594f0f1
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"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment