From a530e5e6e0f7a532885d615d8ec7564cc4634ae2 Mon Sep 17 00:00:00 2001 From: Ari Date: Tue, 31 May 2022 17:13:15 -0400 Subject: [PATCH] clean ups --- .dockerignore | 2 ++ .github/workflows/build.yml | 1 - .github/workflows/test.yml | 1 - Dockerfile | 4 +++- Makefile | 28 +++++++++++++++++++++++++--- README.md | 3 +-- docker/bin/run.sh | 1 + 7 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index a9b8cf0..6a83179 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,5 @@ webapp/node_modules webapp/build webapp/.storybook webapp/.vscode +webapp/.env.local +webapp/tmux.sh \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa1804b..1a2ef80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,5 +30,4 @@ jobs: args: | --${{ matrix.arch }} \ --version ${{ github.event.inputs.version }} \ - --additional-tag edge \ --target . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 76f0b23..6adc786 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -101,5 +101,4 @@ jobs: args: | --${{ matrix.arch }} \ --version ${{ needs.metadata.outputs.version }} \ - --additional-tag edge \ --target . diff --git a/Dockerfile b/Dockerfile index a9a693f..b2aa918 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ ARG BUILD_VERSION # <--- Environment Variables --> ENV HASSIO_TOKEN "" +ENV SUPERVISOR_TOKEN "" ENV BUILD_VERSION $BUILD_VERSION # <--- System Wide Dependencies --> @@ -48,5 +49,6 @@ LABEL \ io.hass.type="addon" \ io.hass.arch="armhf|aarch64|i386|amd64" -CMD [ "/app/bin/run.sh", "/app" ] +ENTRYPOINT [ "/app/bin/run.sh" ] +CMD [ "/app" ] diff --git a/Makefile b/Makefile index 1e60a7c..7cee24f 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,29 @@ -DC=docker-compose -f docker-compose.build.yaml -f docker-compose.test.yaml +BUILD_TAG=$(shell git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g') +DC=BUILD_TAG=${BUILD_TAG} docker-compose -f docker-compose.build.yaml -f docker-compose.test.yaml + +build-with-builder: + docker run \ + --rm \ + --privileged \ + -v ~/.docker:/root/.docker \ + -v /var/run/docker.sock:/var/run/docker.sock:ro \ + -v ${PWD}:/data \ + homeassistant/amd64-builder \ + --amd64 \ + --test \ + --version ${BUILD_TAG} \ + -t /data build: - $(DC) build\ + $(DC) build + +build-no-cache: + $(DC) build --no-cache push: $(DC) push -run: +start: $(MAKE) build $(DC) up -d sleep 1 @@ -21,3 +38,8 @@ ps: stop: $(DC) stop +bash: + $(DC) exec addon bash + +config: + $(DC) config diff --git a/README.md b/README.md index e38d54c..cfe78fd 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/asosnovsky/Shortumation/Manual%20Build) | | Stable | amd64-edge | i386-edge | armv7-edge | aarch64-edge | armhf-edge | | --- | --- | --- | --- | --- | --- | --- | -| Version | ![GitHub release (latest by date)](https://img.shields.io/github/v/release/asosnovsky/Shortumation?label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-amd64?&sort=semver&label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-i386?&sort=semver&label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-armv7?&sort=semver&label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-aarch64?&sort=semver&label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-armhf?&sort=semver&label=&style=for-the-badge) | - +| Version | ![GitHub release (latest by date)](https://img.shields.io/github/v/release/asosnovsky/Shortumation?label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-amd64?&sort=date&label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-i386?&sort=date&label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-armv7?&sort=date&label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-aarch64?&sort=date&label=&style=for-the-badge) | ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/asosnovsky/shortumation-armhf?&sort=date&label=&style=for-the-badge) | A better way to write automations in home-assistant without having to install and run a seperate automation engine! diff --git a/docker/bin/run.sh b/docker/bin/run.sh index 1dbdd2a..322ecfa 100755 --- a/docker/bin/run.sh +++ b/docker/bin/run.sh @@ -5,6 +5,7 @@ api_location=${1} pushd $api_location echo "--------------------" echo "BUILD_VERSION = "$BUILD_VERSION +echo "HASSIO_TOKEN = "$HASSIO_TOKEN echo "SUPERVISOR_TOKEN = "$SUPERVISOR_TOKEN echo $(python --version) echo "--------------------"