-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from danielwelch/0.1
0.1
- Loading branch information
Showing
8 changed files
with
153 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,53 @@ | ||
#!/bin/bash | ||
set -ev | ||
if [ -z ${TRAVIS_TAG} ]; then | ||
echo "Untagged build found." | ||
|
||
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. Building zigbee2mqtt with tag 'test' and zigbee2mqtt 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." | ||
fi | ||
docker run -it --rm --privileged --name ${ADDON_NAME} \ | ||
echo "New git tagged build found. 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} \ | ||
--git \ | ||
--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} | ||
--login "${DOCKER_USERNAME}" \ | ||
--password "${DOCKER_PASSWORD}" \ | ||
--parallel | ||
fi | ||
echo "Local Docker build successful." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,63 @@ | ||
#!/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 [ "$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 to Docker with tag 'latest'." | ||
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 <[email protected]>" \ | ||
--doc-url "${GITHUB_URL}" \ | ||
--login "${DOCKER_USERNAME}" \ | ||
--password "${DOCKER_PASSWORD}" \ | ||
--parallel | ||
else | ||
# DIFF="$(git diff HEAD^ HEAD dropbox-sync)" | ||
# if [ -z $DIFF ]; then | ||
# echo "No changes in Dropbox Sync add-on. Skipping docker push." | ||
# exit 0 | ||
# fi | ||
echo "No tag found. Pushing to Docker with tag 'test'." | ||
fi | ||
echo "No tag found. Pushing zigbee2mqtt and zigbee2mqtt-edge images to Docker with tag 'test'." | ||
|
||
git status | ||
# 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 <[email protected]>" \ | ||
--doc-url "${GITHUB_URL}" \ | ||
--login "${DOCKER_USERNAME}" \ | ||
--password "${DOCKER_PASSWORD}" \ | ||
--parallel | ||
|
||
docker run -it --rm --privileged --name "${ADDON_NAME}" \ | ||
-v ~/.docker:/root/.docker \ | ||
-v "$(pwd)":/docker \ | ||
hassioaddons/build-env:latest \ | ||
--target "${ADDON_NAME}" \ | ||
--git \ | ||
--all \ | ||
--push \ | ||
--from "homeassistant/{arch}-base" \ | ||
--author "Daniel Welch <[email protected]>" \ | ||
--doc-url "${GITHUB_URL}" \ | ||
--login "${DOCKER_USERNAME}" \ | ||
--password "${DOCKER_PASSWORD}" | ||
# 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-latest \ | ||
--push \ | ||
--all \ | ||
--from "homeassistant/{arch}-base" \ | ||
--author "Daniel Welch <[email protected]>" \ | ||
--doc-url "${GITHUB_URL}" \ | ||
--login "${DOCKER_USERNAME}" \ | ||
--password "${DOCKER_PASSWORD}" \ | ||
--parallel | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ARG BUILD_FROM | ||
FROM $BUILD_FROM | ||
|
||
# Add env | ||
ENV LANG C.UTF-8 | ||
|
||
RUN apk add --update --no-cache jq nodejs nodejs-npm python3 python3-dev \ | ||
python2 make gcc g++ linux-headers udev git && \ | ||
pip3 install PyYAML==3.12 && \ | ||
git clone -b '0.1.0' --single-branch --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /app | ||
|
||
COPY run.sh /app/run.sh | ||
COPY set_config.py /app/set_config.py | ||
|
||
WORKDIR /app | ||
|
||
RUN ["chmod", "a+x", "/app/run.sh"] | ||
RUN ["npm", "install", "--unsafe-perm", "-g", "pm2"] | ||
RUN ["npm", "install", "--unsafe-perm"] | ||
RUN apk del make gcc g++ python2 linux-headers udev | ||
|
||
CMD [ "/app/run.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "zigbee2mqtt-edge", | ||
"version": "test", | ||
"slug": "zigbee2mqtt-edge", | ||
"description": "Development build of the zigbee2mqtt add-on.", | ||
"auto_uart": true, | ||
"url": "https://github.com/danielwelch/hassio-zigbee2mqtt", | ||
"startup": "before", | ||
"boot": "auto", | ||
"map": ["share:rw"], | ||
"options": { | ||
"data_path": "/share/zigbee2mqtt", | ||
"homeassistant": true, | ||
"permit_join": false, | ||
"mqtt_base_topic": "zigbee2mqtt", | ||
"mqtt_server": "mqtt://homeassistant", | ||
"serial_port": "/dev/ttyACM0" | ||
}, | ||
"schema": { | ||
"data_path": "str", | ||
"homeassistant": "bool", | ||
"permit_join": "bool", | ||
"mqtt_base_topic": "str", | ||
"mqtt_server": "str", | ||
"serial_port": "str", | ||
"mqtt_user": "str?", | ||
"mqtt_pass": "str?", | ||
"debug": "bool?", | ||
"err": "bool?" | ||
}, | ||
"image": "dwelch2101/zigbee2mqtt-edge-{arch}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters