diff --git a/.travis.yml b/.travis.yml index 951156c..b536a27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -34,6 +48,8 @@ script: - npm test - nosetests -v deploy: +- + skip_cleanup: true provider: pypi user: jonnor skip_upload_docs: true @@ -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 diff --git a/Dockerfile-raspberrypi3 b/Dockerfile-raspberrypi3 new file mode 100644 index 0000000..855de5b --- /dev/null +++ b/Dockerfile-raspberrypi3 @@ -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 diff --git a/dlock13-msgflo/build.sh b/dlock13-msgflo/build.sh index c684542..064a267 100755 --- a/dlock13-msgflo/build.sh +++ b/dlock13-msgflo/build.sh @@ -1,7 +1,6 @@ #!/bin/bash -xe mkdir -p build -git submodule update --init --recursive if [[ $MsgFlo_DIR == "" ]] then diff --git a/docker-compose-raspberrypi3.yaml b/docker-compose-raspberrypi3.yaml new file mode 100644 index 0000000..5348223 --- /dev/null +++ b/docker-compose-raspberrypi3.yaml @@ -0,0 +1,8 @@ +version: '3' +services: + dlock: + image: bitraf/dlock13-rpi + build: + context: . + dockerfile: Dockerfile-raspberrypi3 + container_name: dlock