This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
/
.travis.yml
66 lines (65 loc) · 3.26 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
services:
- docker
language: shell
os: linux
dist: xenial
install:
- sudo apt-get install -y jq
- wget https://github.com/estesp/manifest-tool/releases/download/v1.0.3/manifest-tool-linux-amd64 -O manifest-tool
- chmod +x manifest-tool
script:
# Parse variables
- BUILD_VERSION=$(cat version.json | jq -r .version)
- BUILD_CHANNEL=$(cat version.json | jq -r .channel)
# Build amd64
- docker build --build-arg VERSION=$BUILD_VERSION --build-arg CHANNEL=$BUILD_CHANNEL -t "marthoc/deconz:amd64" ./amd64
# Build armv7
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- docker build --build-arg VERSION=$BUILD_VERSION --build-arg CHANNEL=$BUILD_CHANNEL -t "marthoc/deconz:armv7" ./armv7
# Build arm64
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- docker build --build-arg VERSION=$BUILD_VERSION --build-arg CHANNEL=$BUILD_CHANNEL -t "marthoc/deconz:arm64" ./arm64
after_success:
# Tag and push test images after a successful build
- docker tag marthoc/deconz:amd64 marthoc/deconz:amd64-test
- docker push marthoc/deconz:amd64-test
- docker tag marthoc/deconz:armv7 marthoc/deconz:armv7-test
- docker push marthoc/deconz:armv7-test
- docker tag marthoc/deconz:arm64 marthoc/deconz:arm64-test
- docker push marthoc/deconz:arm64-test
# If merged to master, tag and push production images and update manifests
- >
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_TOKEN"
docker tag marthoc/deconz:amd64 marthoc/deconz:amd64-$BUILD_VERSION
docker push marthoc/deconz:amd64
docker push marthoc/deconz:amd64-$BUILD_VERSION
docker tag marthoc/deconz:armv7 marthoc/deconz:armv7-$BUILD_VERSION
docker tag marthoc/deconz:armv7 marthoc/deconz:armhf
docker tag marthoc/deconz:armv7 marthoc/deconz:armhf-$BUILD_VERSION
docker push marthoc/deconz:armv7
docker push marthoc/deconz:armv7-$BUILD_VERSION
docker push marthoc/deconz:armhf
docker push marthoc/deconz:armhf-$BUILD_VERSION
docker tag marthoc/deconz:arm64 marthoc/deconz:arm64-$BUILD_VERSION
docker tag marthoc/deconz:arm64 marthoc/deconz:aarch64
docker tag marthoc/deconz:arm64 marthoc/deconz:aarch64-$BUILD_VERSION
docker push marthoc/deconz:arm64
docker push marthoc/deconz:arm64-$BUILD_VERSION
docker push marthoc/deconz:aarch64
docker push marthoc/deconz:aarch64-$BUILD_VERSION
./manifest-tool --username $DOCKER_LOGIN --password $DOCKER_PASS push from-args \
--platforms linux/amd64,linux/arm/v7,linux/arm64 \
--template marthoc/deconz:ARCHVARIANT-$BUILD_VERSION \
--target marthoc/deconz:latest
./manifest-tool --username $DOCKER_LOGIN --password $DOCKER_PASS push from-args \
--platforms linux/amd64,linux/arm/v7,linux/arm64 \
--template marthoc/deconz:ARCHVARIANT-$BUILD_VERSION \
--target marthoc/deconz:$BUILD_VERSION
if [ "$BUILD_CHANNEL" == "stable" ]; then
./manifest-tool --username $DOCKER_LOGIN --password $DOCKER_PASS push from-args \
--platforms linux/amd64,linux/arm/v7,linux/arm64 \
--template marthoc/deconz:ARCHVARIANT-$BUILD_VERSION \
--target marthoc/deconz:stable
fi
fi