Browse Source

Feature/docker (#1316)

* Initial Docker Setup

* Setup spectrum and mocha test running containers
tags/v3.4.0
Samuel Attard 3 years ago
parent
commit
ff4ce6dc1b
7 changed files with 83 additions and 1 deletions
  1. 4
    0
      .dockerignore
  2. 2
    0
      .gitignore
  3. 25
    0
      Dockerfile
  4. 18
    0
      docker-compose-linux-build.yml
  5. 22
    0
      docker-compose.yml
  6. 2
    1
      package.json
  7. 10
    0
      vendor/docker-entrypoint.sh

+ 4
- 0
.dockerignore View File

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

+ 2
- 0
.gitignore View File

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

+ 25
- 0
Dockerfile View File

@@ -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
- 0
docker-compose-linux-build.yml View File

@@ -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
- 0
docker-compose.yml View File

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

+ 2
- 1
package.json View File

@@ -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
- 0
vendor/docker-entrypoint.sh View File

@@ -0,0 +1,10 @@
#!/bin/bash

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

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

exec "$@"

Loading…
Cancel
Save