diff --git a/.gitignore b/.gitignore index 947bef18..148cd043 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ config.yml # IDE exclude .idea *.sublime-* + +# Test results +test-results/ diff --git a/package.json b/package.json index 296cf549..ef84b9e1 100644 --- a/package.json +++ b/package.json @@ -145,6 +145,7 @@ "fuse-box": "~2.2.2", "i18next-xhr-backend": "~1.4.2", "jest": "~20.0.4", + "jest-junit": "~3.1.0", "jquery": "~3.2.1", "jquery-contextmenu": "~2.5.0", "jquery-simple-upload": "~1.0.0", @@ -168,6 +169,7 @@ "vuex": "~2.4.0" }, "jest": { + "testResultsProcessor": "./node_modules/jest-junit", "collectCoverage": false, "testMatch": [ "**/test/**/*.js?(x)", @@ -175,6 +177,12 @@ ], "verbose": true }, + "jest-junit": { + "suiteName": "jest test", + "output": "./test-results/junit.xml", + "classNameTemplate": "{classname}-{title}", + "titleTemplate": "{classname}-{title}" + }, "collective": { "type": "opencollective", "url": "https://opencollective.com/wikijs", diff --git a/tools/build/Dockerfile b/tools/build/Dockerfile new file mode 100644 index 00000000..c3bf58be --- /dev/null +++ b/tools/build/Dockerfile @@ -0,0 +1,15 @@ +FROM node:8-alpine +LABEL maintainer="requarks.io" + +RUN apk update && \ + apk add bash curl git openssh supervisor --no-cache && \ + mkdir -p /var/wiki + +WORKDIR /var/wiki + +COPY supervisord.conf /etc/supervisord.conf +COPY . /var/wiki + +EXPOSE 3000 + +CMD ["supervisord", "--nodaemon", "-c", "/etc/supervisord.conf"] diff --git a/tools/build/supervisord.conf b/tools/build/supervisord.conf new file mode 100644 index 00000000..7ff97ef4 --- /dev/null +++ b/tools/build/supervisord.conf @@ -0,0 +1,23 @@ +[unix_http_server] +file=/var/run/supervisor.sock +chmod=0700 + +[supervisord] +logfile=/logs/supervisord.log +pidfile=/var/run/supervisord.pid +childlogdir=/logs + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock + +[program:wikijs] +command = node server +autostart=true +autorestart=true +priority=5 +directory=/var/wiki +stdout_logfile=/logs/wiki-stdout.log +stderr_logfile=/logs/wiki-stderr.log diff --git a/tools/semver_next.sh b/tools/semver_next.sh deleted file mode 100644 index 1c39da9d..00000000 --- a/tools/semver_next.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -# Increment a version string using Semantic Versioning (SemVer) terminology. - -# Parse command line options. - -while getopts ":Mmp" Option -do - case $Option in - M ) major=true;; - m ) minor=true;; - p ) patch=true;; - esac -done - -shift $(($OPTIND - 1)) - -version=$1 - -# Build array from version string. - -a=( ${version//./ } ) - -# If version string is missing or has the wrong number of members, show usage message. - -if [ ${#a[@]} -ne 3 ] -then - echo "usage: $(basename $0) [-Mmp] major.minor.patch" - exit 1 -fi - -# Increment version numbers as requested. - -if [ ! -z $major ] -then - ((a[0]++)) - a[1]=0 - a[2]=0 -fi - -if [ ! -z $minor ] -then - ((a[1]++)) - a[2]=0 -fi - -if [ ! -z $patch ] -then - ((a[2]++)) -fi - -echo "${a[0]}.${a[1]}.${a[2]}" diff --git a/yarn.lock b/yarn.lock index 65a2b572..e1e9f9f2 100644 Binary files a/yarn.lock and b/yarn.lock differ