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

Use Buildkite and Docker for CI #4

Merged
merged 1 commit into from
Nov 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-plugin-universal-events
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-plugin-universal-events
- name: ":chrome: :white_check_mark:"
command: ".buildkite/browserTests"
plugins:
docker-compose#v1.5.2:
run: fusion-plugin-universal-events
- name: ":node: :white_check_mark:"
command: ".buildkite/nodeTests"
plugins:
docker-compose#v1.5.2:
run: fusion-plugin-universal-events
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
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

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-plugin-universal-events

# 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# fusion-plugin-universal-events

[![Build status](https://badge.buildkite.com/de4e30ddb9d019f5a8e3a2519bc0a5cccab25247809cd10c99.svg?branch=master)](https://buildkite.com/uberopensource/fusion-plugin-universal-events)

This is a [Fusion plugin](https://github.com/fusionjs/fusion-core) that captures events emitted from the client, sends them in batches to the server periodically, and allows the server to handle them.

It's useful for when you want to collect data about user actions or other metrics, and send them in bulk to the server to minimize the number of HTTP requests.
Expand Down
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-plugin-universal-events:
build: .
volumes:
- .:/fusion-plugin-universal-events
- /fusion-plugin-universal-events/node_modules/
- /fusion-plugin-universal-events/dist/
- /fusion-plugin-universal-events/dist-tests/