Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Commit

Permalink
Use Docker and Buildkite
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGrandon committed Nov 3, 2017
1 parent d7dcef4 commit 30ac16c
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .buildkite/browserTests
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
export DISPLAY=:99.0
/etc/init.d/xvfb start

./node_modules/.bin/unitest --browser=dist-tests/browser.js
2 changes: 2 additions & 0 deletions .buildkite/nodeTests
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
./node_modules/.bin/unitest --node=dist-tests/node.js
22 changes: 22 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
steps:
- name: ":docker: :package:"
plugins:
docker-compose#v1.5.2:
build: fusion-core
image-repository: 296822479253.dkr.ecr.us-east-2.amazonaws.com/fusionjs
- wait
- name: ":eslint:"
command: "yarn lint"
plugins:
docker-compose#v1.5.2:
run: fusion-core
- name: ":chrome: :white_check_mark:"
command: ".buildkite/browserTests"
plugins:
docker-compose#v1.5.2:
run: fusion-core
- name: ":node: :white_check_mark:"
command: ".buildkite/nodeTests"
plugins:
docker-compose#v1.5.2:
run: fusion-core
8 changes: 8 additions & 0 deletions .buildkite/xvfb_daemon_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
export DISPLAY=:99
/etc/init.d/xvfb start
sleep 1
$@
exit_value=$?
/etc/init.d/xvfb stop
exit $exit_value
23 changes: 23 additions & 0 deletions .buildkite/xvfb_init
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
XVFB=/usr/bin/Xvfb
XVFBARGS="$DISPLAY -ac -screen 0 1024x768x16 +extension RANDR"
PIDFILE=/var/xvfb_${DISPLAY:1}.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
/sbin/start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
echo -n "Stopping virtual X frame buffer: Xvfb"
/sbin/start-stop-daemon --stop --quiet --pidfile $PIDFILE
echo "."
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/xvfb {start|stop|restart}"
exit 1
esac
exit 0
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:8.9.0

WORKDIR /fusion-core

# Install electron dependencies.
ENV DISPLAY :99
ADD .buildkite/xvfb_init /etc/init.d/xvfb
ADD .buildkite/xvfb_daemon_run /usr/bin/xvfb-daemon-run

RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get -y install libgtk2.0-dev libx11-xcb-dev libgtkextra-dev libgconf2-dev libnss3 libasound2 libxtst-dev libxss1 xvfb && \
chmod a+x /etc/init.d/xvfb /usr/bin/xvfb-daemon-run

COPY . .

RUN yarn

RUN yarn build-test
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '2'
services:
fusion-core:
build: .
volumes:
- .:/fusion-core
- /fusion-core/node_modules/
- /fusion-core/dist/
- /fusion-core/dist-tests/

0 comments on commit 30ac16c

Please sign in to comment.