From 7ad9cfed24b2b9be9741815427662bced3ed8d50 Mon Sep 17 00:00:00 2001 From: kvanzuijlen <8818390+kvanzuijlen@users.noreply.github.com> Date: Tue, 23 May 2023 13:06:09 +0000 Subject: [PATCH] WIP: initial commit --- .devcontainer/devcontainer.json | 24 ++++++++++++++++++++++++ .vscode/tasks.json | 19 +++++++++++++++++++ Dockerfile | 19 +++++++++++++++++++ build.yaml | 9 +++++++++ config.yaml | 12 ++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/tasks.json create mode 100644 Dockerfile create mode 100644 build.yaml create mode 100644 config.yaml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..425ef5c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +{ + "name": "Example devcontainer for add-on repositories", + "image": "ghcr.io/home-assistant/devcontainer:addons", + "appPort": ["7123:8123", "7357:4357"], + "postStartCommand": "sudo -E bash devcontainer_bootstrap", + "runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"], + "containerEnv": { + "WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}" + }, + "extensions": ["timonwong.shellcheck", "esbenp.prettier-vscode"], + "mounts": ["type=volume,target=/var/lib/docker"], + "settings": { + "terminal.integrated.profiles.linux": { + "zsh": { + "path": "/usr/bin/zsh" + } + }, + "terminal.integrated.defaultProfile.linux": "zsh", + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "files.trimTrailingWhitespace": true + } +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..f426c2c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,19 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Start Home Assistant", + "type": "shell", + "command": "sudo chmod a+x /usr/bin/supervisor* && sudo -E supervisor_run", + "group": { + "kind": "test", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "new" + }, + "problemMatcher": [] + } + ] +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..170dc7c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +################# +# 1 Build Image # +################# +ARG BUILD_FROM +ARG BUILD_VERSION +FROM $BUILD_FROM + +################## +# 2 Modify Image # +################## + +# Set S6 wait time +ENV S6_CMD_WAIT_FOR_SERVICES=1 \ + S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \ + S6_SERVICES_GRACETIME=0 \ + FLASK_HOST=0.0.0.0 \ + FLASK_PORT=4470 + +LABEL org.opencontainers.image.version=${BUILD_VERSION} \ No newline at end of file diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..714fc5c --- /dev/null +++ b/build.yaml @@ -0,0 +1,9 @@ +build_from: + aarch64: "ghcr.io/kvanzuijlen/ankerctl:v1.0.0" + amd64: "ghcr.io/kvanzuijlen/ankerctl:v1.0.0" + armv7: "ghcr.io/kvanzuijlen/ankerctl:v1.0.0" +labels: + org.opencontainers.image.title: "Home Assistant Add-on: AnkerCTL" + org.opencontainers.image.description: "AnkerCTL" + org.opencontainers.image.source: "https://github.com/AnkerMGMT/AnkerMGMT-homeassistant-addons" + org.opencontainers.image.licenses: "Apache License 2.0" diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..2c24050 --- /dev/null +++ b/config.yaml @@ -0,0 +1,12 @@ +name: "AnkerCTL" +description: "The official AnkerCTL addon" +version: "1.0.0-5" +slug: "ankerctl" +ingress: true +ingress_port: 4470 +ingress_stream: true +init: false +arch: + - aarch64 + - amd64 + - armv7