Merge branch 'dev'

This commit is contained in:
Koenkk
2018-05-11 19:40:19 +02:00
11 changed files with 83 additions and 45 deletions
+22 -4
View File
@@ -9,13 +9,31 @@ build_and_push() {
docker push $DOCKER_USERNAME/zigbee2mqtt:$1
}
push_hassio_addon() {
docker tag $DOCKER_USERNAME/zigbee2mqtt:$1 $DOCKER_USERNAME/zigbee2mqtt-hassioaddon-$2
docker push $DOCKER_USERNAME/zigbee2mqtt-hassioaddon-$2
}
# Only update docker images if on master branch and not pull request
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]
then
echo "Updating docker images!"
echo "Updating docker images for master branch!"
login
build_and_push latest docker/Dockerfile
build_and_push armv7hf docker/Dockerfile.armv7hf
build_and_push latest docker/Dockerfile.amd64
build_and_push arm32v6 docker/Dockerfile.arm32v6
build_and_push arm64v8 docker/Dockerfile.arm64v8
echo "Pushing hass.io addon images"
push_hassio_addon latest amd64
push_hassio_addon arm32v6 armhf
push_hassio_addon arm64v8 aarch64
elif [ "$TRAVIS_BRANCH" = "dev" -a "$TRAVIS_PULL_REQUEST" = "false" ]
then
echo "Updating docker images for dev branch!"
login
build_and_push latest-dev docker/Dockerfile.amd64
build_and_push arm32v6-dev docker/Dockerfile.arm32v6
build_and_push arm64v8-dev docker/Dockerfile.arm64v8
else
echo "Not updating docker images, triggered by pull request or not on master branch"
echo "Not updating docker images, triggered by pull request or not on master/dev branch"
fi
-13
View File
@@ -1,13 +0,0 @@
FROM node:8
# Copy files
ADD . /app
RUN cp /app/data/configuration.yaml /app
RUN cp /app/docker/start.sh /app
RUN chmod +x /app/start.sh
WORKDIR /app
RUN npm install
# Entrypoint
ENTRYPOINT ["./start.sh"]
+16
View File
@@ -0,0 +1,16 @@
FROM alpine:3.7
# Copy files
ADD . /app
RUN cp /app/data/configuration.yaml /app
RUN cp /app/docker/run.sh /app
RUN chmod +x /app/run.sh
WORKDIR /app
# Install dependencies
RUN apk add --update --no-cache make gcc g++ python linux-headers udev nodejs git && \
npm install --unsafe-perm && \
apk del make gcc g++ python linux-headers udev git
# Entrypoint
ENTRYPOINT ["./run.sh"]
+18
View File
@@ -0,0 +1,18 @@
FROM arm32v6/alpine:3.7
# Setup cross-build
ENV QEMU_EXECVE 1
COPY docker/qemu-arm-static /usr/bin
WORKDIR /app
# Copy files & install dependencies
ADD . /app
RUN [ "qemu-arm-static", "/bin/sh", "-c", \
"cp /app/data/configuration.yaml /app && \
cp /app/docker/run.sh /app && chmod +x /app/run.sh && \
apk add --update --no-cache make gcc g++ python linux-headers udev nodejs git && \
npm install --unsafe-perm && \
apk del make gcc g++ python linux-headers udev git"]
# Entrypoint
ENTRYPOINT ["./run.sh"]
+18
View File
@@ -0,0 +1,18 @@
FROM arm64v8/alpine:3.7
# Setup cross-build
ENV QEMU_EXECVE 1
COPY docker/qemu-aarch64-static /usr/bin
WORKDIR /app
# Copy files & install dependencies
ADD . /app
RUN [ "qemu-aarch64-static", "/bin/sh", "-c", \
"cp /app/data/configuration.yaml /app && \
cp /app/docker/run.sh /app && chmod +x /app/run.sh && \
apk add --update --no-cache make gcc g++ python linux-headers udev nodejs git && \
npm install --unsafe-perm && \
apk del make gcc g++ python linux-headers udev git"]
# Entrypoint
ENTRYPOINT ["./run.sh"]
-24
View File
@@ -1,24 +0,0 @@
FROM resin/armv7hf-debian
RUN [ "cross-build-start" ]
# Install nodejs and git
RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
RUN apt-get update && apt-get install -y git nodejs make g++ && rm -rf /var/lib/apt/lists/*
# Copy files
ADD . /app
RUN cp /app/data/configuration.yaml /app
RUN cp /app/docker/start.sh /app
RUN chmod +x /app/start.sh
WORKDIR /app
RUN npm install
# Cleanup
RUN apt-get purge g++ make && apt-get autoremove && rm -rf /var/lib/apt/lists/*
RUN [ "cross-build-end" ]
# Entrypoint
ENTRYPOINT ["./start.sh"]
+1
View File
@@ -0,0 +1 @@
qemu-aarch64-static and qemu-arm-static are taken from https://github.com/resin-io/qemu/releases/tag/v2.9.0%2Bresin1
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
if [ ! -f /app/data/configuration.yaml ]; then
echo "Creating configuration file..."
cp /app/configuration.yaml /app/data/configuration.yaml
fi
npm start
-4
View File
@@ -1,4 +0,0 @@
#!/bin/bash
cp -n /app/configuration.yaml /app/data/configuration.yaml
npm start