Browse Source

Feature/docker (#1316)

* Initial Docker Setup

* Setup spectrum and mocha test running containers
pull/1339/head
Samuel Attard 5 years ago
committed by GitHub
parent
commit
ff4ce6dc1b
  1. 4
      .dockerignore
  2. 2
      .gitignore
  3. 25
      Dockerfile
  4. 18
      docker-compose-linux-build.yml
  5. 22
      docker-compose.yml
  6. 3
      package.json
  7. 10
      vendor/docker-entrypoint.sh

4
.dockerignore

@ -0,0 +1,4 @@
node_modules/
build/
dist/
.git/

2
.gitignore

@ -4,3 +4,5 @@ dist/
.settings.json
xunit.xml
vendor/*.msi
electron.xml
spectron.xml

25
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
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
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
package.json

@ -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"

10
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 "$@"
Loading…
Cancel
Save