forked from diyhue/diyHue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (45 loc) · 1.82 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
41
42
43
44
45
46
47
sudo: required
services:
- docker
language: bash
env:
- ARCH=amd64
- ARCH=arm
- ARCH=aarch64
script:
# Setup QEMU for ARM image build
- docker run --rm --privileged multiarch/qemu-user-static:register
# Build image
- docker build -t diyhue/core:$ARCH -f ./.build/$ARCH.Dockerfile .
# Login, tag and push dev image
#- docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
#- docker tag diyhue/core:$ARCH diyhue/core:$ARCH-dev
#- docker push diyhue/core:$ARCH-dev
# Pull dev image to run tests
- docker run -d --name "diyHue" --network="host" -v '/mnt/hue-emulator/export/':'/opt/hue-emulator/export/':'rw' -e 'MAC=b8:27:eb:d4:dc:11' -e 'IP=192.168.1.123' -e 'DECONZ=192.168.1.111' -e 'IP_RANGE=5,200' -e 'DEBUG=true' diyhue/core:$ARCH
# Wait for logs to populate, then list them
- sleep 30
- docker logs diyHue
# Kill and remove test container
- docker kill diyHue
- docker rm diyHue
- docker history diyhue/core:$ARCH
- docker images
after_success:
# Tag and push built images
- >
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
docker tag diyhue/core:$ARCH diyhue/core:$ARCH-$TRAVIS_COMMIT
docker push diyhue/core:$ARCH
docker push diyhue/core:$ARCH-$TRAVIS_COMMIT
# Download manifest-tool
wget https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-amd64
mv manifest-tool-linux-amd64 manifest-tool
chmod +x manifest-tool
# Push manifest-list
./manifest-tool push from-args --platforms linux/amd64,linux/arm --template "diyhue/core:ARCH-${TRAVIS_COMMIT}" --target "diyhue/core:$TRAVIS_COMMIT"
./manifest-tool push from-args --platforms linux/amd64,linux/arm --template "diyhue/core:ARCH-${TRAVIS_COMMIT}" --target "diyhue/core:latest"
fi
notifications:
slack: diyhue:84x97ehqLW4B6pe9ntP16SOI