Skip to content

Commit

Permalink
Feature/docker (#1316)
Browse files Browse the repository at this point in the history
* Initial Docker Setup

* Setup spectrum and mocha test running containers
  • Loading branch information
MarshallOfSound committed Jul 15, 2016
1 parent 414364b commit ff4ce6d
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .dockerignore
@@ -0,0 +1,4 @@
node_modules/
build/
dist/
.git/
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,5 @@ dist/
.settings.json
xunit.xml
vendor/*.msi
electron.xml
spectron.xml
25 changes: 25 additions & 0 deletions Dockerfile
@@ -0,0 +1,25 @@
FROM node:6.3

RUN apt-get update
RUN apt-get install g++-multilib lib32z1 lib32ncurses5 -y
RUN apt-get install rpm fakeroot dpkg libdbus-1-dev libx11-dev -y
RUN apt-get install libavahi-compat-libdnssd-dev g++ -y
RUN apt-get install gcc-4.8-multilib g++-4.8-multilib -y
RUN apt-get install libgtk2.0-0 libgtk2.0-dev xvfb -y
RUN apt-get install libxtst6 -y

WORKDIR /app

COPY package.json /app
RUN npm install

RUN apt-get install libxss1 libnss3 libasound2 libgconf-2-4 -y

RUN export ELECTRON_ENABLE_STACK_DUMPING=true
RUN export ELECTRON_ENABLE_LOGGING=true

ADD vendor/docker-entrypoint.sh /entrypoint.sh
RUN chmod 777 /entrypoint.sh
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]

COPY . /app
18 changes: 18 additions & 0 deletions docker-compose-linux-build.yml
@@ -0,0 +1,18 @@
version: '2'

services:
debian-64:
build: .
command: npm run make:deb:64
volumes:
- ./dist:/dist

fedora-64:
build: .
command: npm run make:rpm:64
volumes:
- ./dist:/dist

volumes:
checkout:
driver: local
22 changes: 22 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,22 @@
version: '2'

services:
test-runner:
build: .
command: npm run test-unit
volumes:
- .:/test-output
environment:
XUNIT_FILE: '/test-output/electron.xml'

spec-runner:
build: .
command: npm run test-spec
volumes:
- .:/test-output
environment:
XUNIT_FILE: '/test-output/spectron.xml'

volumes:
checkout:
driver: local
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -26,8 +26,9 @@
"postinstall": "node vendor/rebuild.js --instant",
"test": "npm run lint",
"pretest-unit": "npm run build",
"pretest-spec": "npm run build",
"test-unit": "electron-mocha ./test/electron --recursive --compilers js:babel-core/register --timeout 10000 -R spec-xunit-file",
"test-spec": "mocha ./test/spectron --compilers js:babel-core/register -R spec --timeout 10000",
"test-spec": "mocha ./test/spectron --compilers js:babel-core/register -R spec-xunit-file --timeout 10000",
"prestart": "pre-flight",
"start": "electron . --dev",
"watch": "gulp watch"
Expand Down
10 changes: 10 additions & 0 deletions vendor/docker-entrypoint.sh
@@ -0,0 +1,10 @@
#!/bin/bash

echo "Starting Xvfb"
Xvfb :99 -ac &
sleep 2

export DISPLAY=:99
echo "Executing command $@"

exec "$@"

0 comments on commit ff4ce6d

Please sign in to comment.