-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.travis.yml
40 lines (36 loc) · 1.66 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
sudo: true
before_install:
- sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa -y
- sudo apt-get update -y
- sudo apt-get install mosquitto -y
services:
- docker
before_script:
- sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
- echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | sudo tee -a /proc/sys/fs/binfmt_misc/register
jobs:
include:
- stage: test
script:
- nvm install 6
- npm install
- npm test
after_success: skip
- stage: build docker image
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -f Dockerfile.armhf -t hm2mqtt_armhf .
- docker images
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo $(npm view hm2mqtt version); else echo -$TRAVIS_BRANCH ; fi`
- docker tag hm2mqtt_armhf mqttsmarthome/hm2mqtt_armhf:$TAG
- docker tag hm2mqtt_armhf mqttsmarthome/hm2mqtt_armhf:latest
- stage: test docker image
script:
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo $(npm view hm2mqtt version); else echo -$TRAVIS_BRANCH ; fi`
- docker run -d mqttsmarthome/hm2mqtt_armhf:$TAG
- docker ps | grep armhf
after_success:
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo $(npm view hm2mqtt version); else echo -$TRAVIS_BRANCH ; fi`
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker push mqttsmarthome/hm2mqtt_armhf:$TAG
- docker push mqttsmarthome/hm2mqtt_armhf:latest