forked from danielwelch/hassio-zigbee2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·52 lines (51 loc) · 1.84 KB
/
build.sh
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
#!/bin/bash
set -ev
if [ -z "${TRAVIS_TAG}" ]; then
echo "Untagged build found. Testing building zigbee2mqtt with tag 'test' and zigbee2mqtt-edge with tag 'test'."
# build zigbee2mqtt
docker run -it --rm --privileged --name "${ADDON_NAME}" \
-v ~/.docker:/root/.docker \
-v "$(pwd)":/docker \
hassioaddons/build-env:latest \
--target "${ADDON_NAME}" \
--tag-test \
--all \
--from "homeassistant/{arch}-base" \
--author "Daniel Welch <dwelch2102@gmail.com>" \
--doc-url "${GITHUB_URL}" \
--login "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}" \
--parallel
# build zigbee2mqtt-edge
docker run -it --rm --privileged --name "${ADDON_NAME_EDGE}" \
-v ~/.docker:/root/.docker \
-v "$(pwd)":/docker \
hassioaddons/build-env:latest \
--target "${ADDON_NAME_EDGE}" \
--tag-test \
--all \
--from "homeassistant/{arch}-base" \
--author "Daniel Welch <dwelch2102@gmail.com>" \
--doc-url "${GITHUB_URL}" \
--login "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}" \
--parallel \
--arg COMMIT "${TRAVIS_COMMIT}"
else
echo "New git tagged build found. Testing building zigbee2mqtt with tag 'latest'."
docker run -it --rm --privileged --name "${ADDON_NAME}" \
-v ~/.docker:/root/.docker \
-v "$(pwd)":/docker \
hassioaddons/build-env:latest \
--target "${ADDON_NAME}" \
--tag-latest \
--all \
--from "homeassistant/{arch}-base" \
--author "Daniel Welch <dwelch2102@gmail.com>" \
--doc-url "${GITHUB_URL}" \
--login "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}" \
--parallel \
--arg COMMIT "${TRAVIS_COMMIT}"
fi
echo "Local Docker build successful."