Skip to content

Commit

Permalink
Merge pull request #5 from bitraf/build-rpi
Browse files Browse the repository at this point in the history
Build for Raspberry Pi on Travis
  • Loading branch information
jonnor authored Nov 7, 2017
2 parents 794b169 + af9a42c commit 85b82a6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
31 changes: 28 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@ node_js:
- '8'
sudo: true
dist: trusty
services:
- docker
env:
- MSGFLO_BROKER=mqtt://localhost
global:
- MSGFLO_BROKER=mqtt://localhost
matrix:
- TARGET=x86
- TARGET=raspberrypi3 DOCKER_FILE=Dockerfile-raspberrypi3
before_install:
- sudo apt-get update -qq
- sudo apt-get install pkg-config libev-dev cmake openssl libc-ares-dev
- if [ "$TARGET" == "raspberrypi3" ]; then docker run --rm --privileged multiarch/qemu-user-static:register
--reset; fi
install:
- export CC=gcc-4.8
- export CXX=g++-4.8
- mkdir -p dlock13-$TARGET/bin
- if [ "$TARGET" == "raspberrypi3" ]; then docker-compose -f docker-compose-raspberrypi3.yaml
build; fi
- if [ "$TARGET" == "raspberrypi3" ]; then docker run -it bitraf/dlock13-rpi /bin/true;
fi
- if [ "$TARGET" == "raspberrypi3" ]; then docker cp `docker ps -alq`:/var/app/build/dlock13
./dlock13-$TARGET/bin/; fi
- zip -r dlock13-$TARGET.zip dlock13-$TARGET/
- wget http://mosquitto.org/files/source/mosquitto-1.3.1.tar.gz
- tar xzf mosquitto-1.3.1.tar.gz
- cd mosquitto-1.3.1
Expand All @@ -34,6 +48,8 @@ script:
- npm test
- nosetests -v
deploy:
-
skip_cleanup: true
provider: pypi
user: jonnor
skip_upload_docs: true
Expand All @@ -42,3 +58,12 @@ deploy:
on:
tags: true
repo: bitraf/dlock13
-
provider: releases
api_key:
secure: dGFUrHBNucrnE6XLFtovIcJ5YI89RkmWmaKzA6kSut8NggPJyRc+6LO/yfQDIbhuJf702k9jP1Bilsm3F27Eff+trT4CTnXLHAPFSAAzd+2vDMumwwqTPDqzXI4UYYr+VuaO2on4oDFGZODdGrtN92OfwH3T4wuEMzqwJeFzG1g=
file: ./dlock13-$TARGET.zip
skip_cleanup: true
on:
tags: true
repo: bitraf/dlock13
14 changes: 14 additions & 0 deletions Dockerfile-raspberrypi3
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM resin/rpi-raspbian:jessie-20171101

RUN mkdir -p /var/app
WORKDIR /var/app

# Install Dlock13 sources
COPY ./dlock13-msgflo /var/app/

# Install dependencies
RUN apt-get update
RUN apt-get install libmosquitto-dev libev-dev git cmake g++ build-essential

# Run build
RUN ./build.sh
1 change: 0 additions & 1 deletion dlock13-msgflo/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash -xe

mkdir -p build
git submodule update --init --recursive

if [[ $MsgFlo_DIR == "" ]]
then
Expand Down
8 changes: 8 additions & 0 deletions docker-compose-raspberrypi3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
dlock:
image: bitraf/dlock13-rpi
build:
context: .
dockerfile: Dockerfile-raspberrypi3
container_name: dlock

0 comments on commit 85b82a6

Please sign in to comment.