forked from danielwelch/hassio-zigbee2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdistribute.sh
executable file
·64 lines (58 loc) · 2.23 KB
/
distribute.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
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -ev
cp "${TRAVIS_BUILD_DIR}"/zigbee2mqtt/run.sh "${TRAVIS_BUILD_DIR}"/zigbee2mqtt-edge/run.sh
cp "${TRAVIS_BUILD_DIR}"/zigbee2mqtt/requirements.txt "${TRAVIS_BUILD_DIR}"/zigbee2mqtt-edge/requirements.txt
cp "${TRAVIS_BUILD_DIR}"/zigbee2mqtt/set_config.py "${TRAVIS_BUILD_DIR}"/zigbee2mqtt-edge/set_config.py
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "This build is a pull request, aborting distribution script."
exit 0
fi
if [ ! -z "$TRAVIS_TAG" ]; then
echo "Tagged build found. Pushing zigbee2mqtt image to Docker 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 \
--push \
--all \
--from "homeassistant/{arch}-base" \
--author "Daniel Welch <dwelch2102@gmail.com>" \
--doc-url "${GITHUB_URL}" \
--login "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}" \
--parallel
else
echo "No tag found. Pushing zigbee2mqtt and zigbee2mqtt-edge images to Docker with tag 'test'."
# distribute zigbee2mqtt with tag test
docker run -it --rm --privileged --name "${ADDON_NAME}" \
-v ~/.docker:/root/.docker \
-v "$(pwd)":/docker \
hassioaddons/build-env:latest \
--target "${ADDON_NAME}" \
--tag-latest \
--push \
--all \
--from "homeassistant/{arch}-base" \
--author "Daniel Welch <dwelch2102@gmail.com>" \
--doc-url "${GITHUB_URL}" \
--login "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}" \
--parallel
# distribute zigbee2mqtt-edge with tag test
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 \
--push \
--all \
--from "homeassistant/{arch}-base" \
--author "Daniel Welch <dwelch2102@gmail.com>" \
--doc-url "${GITHUB_URL}" \
--login "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}" \
--parallel
fi