From 1358be115733cbe48ff4ab63b169fdad2491c573 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Thu, 27 Jun 2019 13:30:52 +0200 Subject: [PATCH] initial --- .gitignore | 2 ++ .gitlab-ci.yml | 21 +++++++++++++++++++++ Dockerfile | 24 ++++++++++++++++++++++++ VERSION | 1 + 4 files changed, 48 insertions(+) create mode 100644 .gitignore create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile create mode 100644 VERSION diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4cf8c91 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +.*~ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..563e6f6 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,21 @@ +image: docker:stable + +stages: + - build + +variables: + IMAGE_NAME: registry.gitlab.com/wolutator/hkd + +build: + stage: build + tags: + - hottis + - linux + - docker + script: + - VERSION=`cat VERSION` + - docker build --tag $IMAGE_NAME:latest --tag $IMAGE_NAME:$VERSION . + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker push $IMAGE_NAME:latest + - docker push $IMAGE_NAME:$VERSION + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8dbbdde --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM node:8 + +LABEL Maintainer="Wolfgang Hottgenroth " +LABEL ImageName="registry.gitlab.com/wolutator/hkd" + +ARG PIN="031-45-154" +ARG BROKER="mqtt://127.0.0.1" +ARG DATA_DIR="/opt/app" +ARG STORAGE_DIR="/opt/app/storage" + +RUN \ + node install -g homekit2mqtt --unsafe-perm && \ + mkdir -p ${DATA_DIR} && \ + touch ${DATA_DIR}/mapping.json && \ + mkdir -p ${STORAGE_DIR} + + +VOLUME ${DATA_DIR} +EXPOSE 51826 +EXPOSE 51888 + +CMD [ "homekit2mqtt", "-m", ${DATA_DIR}"/mapping.json", "-u", ${BROKER}, "-s" ${STORAGE_DIR}, "--insecure", "-c", $PIN ] + + diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..49d5957 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1