Skip to content

Commit 85b82a6

Browse files
authored
Merge pull request #5 from bitraf/build-rpi
Build for Raspberry Pi on Travis
2 parents 794b169 + af9a42c commit 85b82a6

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed

.travis.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,28 @@ node_js:
33
- '8'
44
sudo: true
55
dist: trusty
6+
services:
7+
- docker
68
env:
7-
- MSGFLO_BROKER=mqtt://localhost
9+
global:
10+
- MSGFLO_BROKER=mqtt://localhost
11+
matrix:
12+
- TARGET=x86
13+
- TARGET=raspberrypi3 DOCKER_FILE=Dockerfile-raspberrypi3
814
before_install:
915
- sudo apt-get update -qq
1016
- sudo apt-get install pkg-config libev-dev cmake openssl libc-ares-dev
17+
- if [ "$TARGET" == "raspberrypi3" ]; then docker run --rm --privileged multiarch/qemu-user-static:register
18+
--reset; fi
1119
install:
12-
- export CC=gcc-4.8
13-
- export CXX=g++-4.8
20+
- mkdir -p dlock13-$TARGET/bin
21+
- if [ "$TARGET" == "raspberrypi3" ]; then docker-compose -f docker-compose-raspberrypi3.yaml
22+
build; fi
23+
- if [ "$TARGET" == "raspberrypi3" ]; then docker run -it bitraf/dlock13-rpi /bin/true;
24+
fi
25+
- if [ "$TARGET" == "raspberrypi3" ]; then docker cp `docker ps -alq`:/var/app/build/dlock13
26+
./dlock13-$TARGET/bin/; fi
27+
- zip -r dlock13-$TARGET.zip dlock13-$TARGET/
1428
- wget http://mosquitto.org/files/source/mosquitto-1.3.1.tar.gz
1529
- tar xzf mosquitto-1.3.1.tar.gz
1630
- cd mosquitto-1.3.1
@@ -34,6 +48,8 @@ script:
3448
- npm test
3549
- nosetests -v
3650
deploy:
51+
-
52+
skip_cleanup: true
3753
provider: pypi
3854
user: jonnor
3955
skip_upload_docs: true
@@ -42,3 +58,12 @@ deploy:
4258
on:
4359
tags: true
4460
repo: bitraf/dlock13
61+
-
62+
provider: releases
63+
api_key:
64+
secure: dGFUrHBNucrnE6XLFtovIcJ5YI89RkmWmaKzA6kSut8NggPJyRc+6LO/yfQDIbhuJf702k9jP1Bilsm3F27Eff+trT4CTnXLHAPFSAAzd+2vDMumwwqTPDqzXI4UYYr+VuaO2on4oDFGZODdGrtN92OfwH3T4wuEMzqwJeFzG1g=
65+
file: ./dlock13-$TARGET.zip
66+
skip_cleanup: true
67+
on:
68+
tags: true
69+
repo: bitraf/dlock13

Dockerfile-raspberrypi3

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM resin/rpi-raspbian:jessie-20171101
2+
3+
RUN mkdir -p /var/app
4+
WORKDIR /var/app
5+
6+
# Install Dlock13 sources
7+
COPY ./dlock13-msgflo /var/app/
8+
9+
# Install dependencies
10+
RUN apt-get update
11+
RUN apt-get install libmosquitto-dev libev-dev git cmake g++ build-essential
12+
13+
# Run build
14+
RUN ./build.sh

dlock13-msgflo/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash -xe
22

33
mkdir -p build
4-
git submodule update --init --recursive
54

65
if [[ $MsgFlo_DIR == "" ]]
76
then

docker-compose-raspberrypi3.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3'
2+
services:
3+
dlock:
4+
image: bitraf/dlock13-rpi
5+
build:
6+
context: .
7+
dockerfile: Dockerfile-raspberrypi3
8+
container_name: dlock

0 commit comments

Comments
 (0)