forked from danielwelch/hassio-zigbee2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·53 lines (51 loc) · 1.95 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
53
#!/bin/bash
set -ev
cp "${TRAVIS_BUILD_DIR}"/zigbee2mqtt/run.sh "${TRAVIS_BUILD_DIR}"/zigbee2mqtt-edge/run.sh
cp "${TRAVIS_BUILD_DIR}"/zigbee2mqtt/set_config.py "${TRAVIS_BUILD_DIR}"/zigbee2mqtt-edge/set_config.py
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 <[email protected]>" \
--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 <[email protected]>" \
--doc-url "${GITHUB_URL}" \
--login "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}" \
--parallel
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 <[email protected]>" \
--doc-url "${GITHUB_URL}" \
--login "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}" \
--parallel
fi
echo "Local Docker build successful."