From e7b859f22dab12ea5bcff81dce2b156b45fe73b9 Mon Sep 17 00:00:00 2001 From: buanet Date: Tue, 14 Dec 2021 17:44:12 +0100 Subject: [PATCH 1/9] testing --- .VERSION | 2 +- .github/workflows/build-debian-image-beta-node16.yml | 4 ++-- .github/workflows/build-debian-image-beta.yml | 2 +- .github/workflows/build-debian-image-dev-node16.yml | 2 +- .github/workflows/build-debian-image-dev.yml | 2 +- .github/workflows/build-debian-image-main.yml | 2 +- .github/workflows/build-debian-image-main_iob.yml | 2 +- CHANGELOG.md | 9 ++++++--- debian/scripts/iobroker_startup.sh | 1 + debian/scripts/maintenance.sh | 1 + src/README_docker_hub_buanet.md | 10 +++++----- src/README_docker_hub_iobroker.md | 12 +++++++----- 12 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.VERSION b/.VERSION index 9773998..6421407 100644 --- a/.VERSION +++ b/.VERSION @@ -1 +1 @@ -v6.0.0 +v6.1.0-beta.1 \ No newline at end of file diff --git a/.github/workflows/build-debian-image-beta-node16.yml b/.github/workflows/build-debian-image-beta-node16.yml index 6936c86..1b4b693 100644 --- a/.github/workflows/build-debian-image-beta-node16.yml +++ b/.github/workflows/build-debian-image-beta-node16.yml @@ -1,7 +1,8 @@ # Github action to build Docker image from beta branch (tag: beta) -name: Build debian based image (beta-node16) +name: Build debian image (beta-node16) on: + workflow_dispatch: pull_request: branches: - beta @@ -9,7 +10,6 @@ on: - closed schedule: - cron: '42 3 * * 1' - workflow_dispatch: jobs: bulid-beta-node16-image: diff --git a/.github/workflows/build-debian-image-beta.yml b/.github/workflows/build-debian-image-beta.yml index f172eba..fcf8c6d 100644 --- a/.github/workflows/build-debian-image-beta.yml +++ b/.github/workflows/build-debian-image-beta.yml @@ -1,5 +1,5 @@ # Github action to build Docker image from beta branch (tag: beta) -name: Build debian based image (beta) +name: Build debian image (beta) on: workflow_dispatch: diff --git a/.github/workflows/build-debian-image-dev-node16.yml b/.github/workflows/build-debian-image-dev-node16.yml index eed6df8..9f95ad6 100644 --- a/.github/workflows/build-debian-image-dev-node16.yml +++ b/.github/workflows/build-debian-image-dev-node16.yml @@ -1,5 +1,5 @@ # Github action to build Docker image from dev branch (tag: dev) -name: Build debian based image (dev-node16) +name: Build debian image (dev-node16) on: workflow_dispatch: diff --git a/.github/workflows/build-debian-image-dev.yml b/.github/workflows/build-debian-image-dev.yml index dd1db9c..f87ad18 100644 --- a/.github/workflows/build-debian-image-dev.yml +++ b/.github/workflows/build-debian-image-dev.yml @@ -1,5 +1,5 @@ # Github action to build Docker image from dev branch (tag: dev) -name: Build debian based image (dev) +name: Build debian image (dev) on: workflow_dispatch: diff --git a/.github/workflows/build-debian-image-main.yml b/.github/workflows/build-debian-image-main.yml index 6e4ba53..a16cc5b 100644 --- a/.github/workflows/build-debian-image-main.yml +++ b/.github/workflows/build-debian-image-main.yml @@ -1,5 +1,5 @@ # Github action to build Docker image from main branch (tag: latest) -name: Build debian based image (latest) +name: Build debian image (latest) on: workflow_dispatch: diff --git a/.github/workflows/build-debian-image-main_iob.yml b/.github/workflows/build-debian-image-main_iob.yml index 496d835..3523d7d 100644 --- a/.github/workflows/build-debian-image-main_iob.yml +++ b/.github/workflows/build-debian-image-main_iob.yml @@ -1,5 +1,5 @@ # Github action to build Docker image from main branch for iobroker/iobroker (tag: latest) -name: Build debian based image (latest) +name: Build debian image (latest) on: workflow_dispatch: diff --git a/CHANGELOG.md b/CHANGELOG.md index c8482e5..2b0ea08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog +### v6.1.0-beta.1 (2021-12-14) +* added alias "m" for maintenance script + ### v6.0.0 (2021-12-09) * moving docu/ restructuring readme * v6.0.0-beta1 (2021-10-07) @@ -29,12 +32,12 @@ * adding labels in OCI standard format * adding packages update on first start * adding file for docker detection by ioBroker adapters - * adding best practice for states db migation in readme + * adding best practice for states db migration in readme * removing couchdb option for states db (no longer supported) * v5.2.0-beta1 (2021-05-04) * added upgrade parameter to maintenance script * added expose for default admin ui port (#172) - * added shortform for maintenance script + * added short form for maintenance script * v5.2.0-beta (2021-04-02) * some renaming to optimize automated build * changes in versioning @@ -43,7 +46,7 @@ ### v5.1.0 (2020-11-05) * v5.0.2-beta (2020-07-28) * added docker tag for majorversion latest - * extend readme.md doku + * extend readme.md docu * added maintenance script * added container healthcheck * fixed configuration procedure and logging for objects and states db setup diff --git a/debian/scripts/iobroker_startup.sh b/debian/scripts/iobroker_startup.sh index 5a7fb41..e268ff5 100644 --- a/debian/scripts/iobroker_startup.sh +++ b/debian/scripts/iobroker_startup.sh @@ -86,6 +86,7 @@ then echo "Registering maintenance script as command..." echo "alias maintenance=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc echo "alias maint=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc + echo "alias m=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc echo "Done." echo ' ' fi diff --git a/debian/scripts/maintenance.sh b/debian/scripts/maintenance.sh index a02a60a..28a66d7 100644 --- a/debian/scripts/maintenance.sh +++ b/debian/scripts/maintenance.sh @@ -17,6 +17,7 @@ display_help() { echo '' echo "Usage: maintenance [ COMMAND ] [ OPTION ]" echo " maint [ COMMAND ] [ OPTION ]" + echo " m [ COMMAND ] [ OPTION ]" echo '' echo "COMMANDS" echo "------------------" diff --git a/src/README_docker_hub_buanet.md b/src/README_docker_hub_buanet.md index 97c8d2f..878e550 100644 --- a/src/README_docker_hub_buanet.md +++ b/src/README_docker_hub_buanet.md @@ -1,8 +1,8 @@ - + -[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/buanet/iobroker/latest?style=flat)](https://hub.docker.com/repository/docker/buanet/iobroker) -[![Docker Pulls](https://img.shields.io/docker/pulls/buanet/iobroker?style=flat)](https://hub.docker.com/repository/docker/buanet/iobroker) -[![Docker Stars](https://img.shields.io/docker/stars/buanet/iobroker?style=flat)](https://hub.docker.com/repository/docker/buanet/iobroker)
+[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/buanet/iobroker/latest?style=flat)](https://hub.docker.com/r/buanet/iobroker) +[![Docker Pulls](https://img.shields.io/docker/pulls/buanet/iobroker?style=flat)](https://hub.docker.com/r/buanet/iobroker) +[![Docker Stars](https://img.shields.io/docker/stars/buanet/iobroker?style=flat)](https://hub.docker.com/r/buanet/iobroker)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/buanet/ioBroker.docker/Build%20debian%20based%20image%20\(latest\))](https://github.com/buanet/ioBroker.docker/actions/workflows/build-debian-image-main.yml) [![Release](https://img.shields.io/github/v/release/buanet/ioBroker.docker?style=flat)](https://github.com/buanet/ioBroker.docker/releases) [![Github Issues](https://img.shields.io/github/issues/buanet/ioBroker.docker?style=flat)](https://github.com/buanet/ioBroker.docker/issues)
@@ -10,7 +10,7 @@ [![License](https://img.shields.io/github/license/buanet/ioBroker.docker?style=flat)](https://github.com/buanet/ioBroker.docker/blob/master/LICENSE.md) [![Donate](https://img.shields.io/badge/donate-paypal-blue?style=flat)](https://paypal.me/buanet) -# Important Note +# Important note New major image versions (e.g. v4, v5, v6) always come with a new major version of node! This might lead to problems when you update your ioBroker container by simply recreating it from the new major version image! To avoid having trouble with recompiling adapters, it is recommended to upgrade your container manually with backup and restore procedure. For more details please see the maintenance part of the new [ioBroker Docker image docs](https://docs.buanet.de/iobroker-docker-image/docs/#maintenance). diff --git a/src/README_docker_hub_iobroker.md b/src/README_docker_hub_iobroker.md index 35de2fd..9dd114b 100644 --- a/src/README_docker_hub_iobroker.md +++ b/src/README_docker_hub_iobroker.md @@ -1,15 +1,17 @@ - +###### [iobroker/iobroker](https://hub.docker.com/r/iobroker/iobroker) is an alias for [buanet/iobroker](https://hub.docker.com/r/buanet/iobroker) + + -[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/buanet/iobroker/latest?style=flat)](https://hub.docker.com/repository/docker/buanet/iobroker) -[![Docker Pulls](https://img.shields.io/docker/pulls/buanet/iobroker?style=flat)](https://hub.docker.com/repository/docker/buanet/iobroker) -[![Docker Stars](https://img.shields.io/docker/stars/buanet/iobroker?style=flat)](https://hub.docker.com/repository/docker/buanet/iobroker)
+[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/buanet/iobroker/latest?style=flat)](https://hub.docker.com/r/buanet/iobroker) +[![Docker Pulls](https://img.shields.io/docker/pulls/buanet/iobroker?style=flat)](https://hub.docker.com/r/buanet/iobroker) +[![Docker Stars](https://img.shields.io/docker/stars/buanet/iobroker?style=flat)](https://hub.docker.com/r/buanet/iobroker)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/buanet/ioBroker.docker/Build%20debian%20based%20image%20\(latest\))](https://github.com/buanet/ioBroker.docker/actions/workflows/build-debian-image-main.yml) [![Release](https://img.shields.io/github/v/release/buanet/ioBroker.docker?style=flat)](https://github.com/buanet/ioBroker.docker/releases) [![Github Issues](https://img.shields.io/github/issues/buanet/ioBroker.docker?style=flat)](https://github.com/buanet/ioBroker.docker/issues)
[![Source](https://img.shields.io/badge/source-github-blue?style=flat)](https://github.com/buanet/ioBroker.docker) [![License](https://img.shields.io/github/license/buanet/ioBroker.docker?style=flat)](https://github.com/buanet/ioBroker.docker/blob/master/LICENSE.md) -# Important Note +# Important note New major image versions (e.g. v4, v5, v6) always come with a new major version of node! This might lead to problems when you update your ioBroker container by simply recreating it from the new major version image! To avoid having trouble with recompiling adapters, it is recommended to upgrade your container manually with backup and restore procedure. For more details please see the maintenance part of the new [ioBroker Docker image docs](https://docs.buanet.de/iobroker-docker-image/docs/#maintenance). From f3861e8fb5a1cf1ee4eef61448f66f96329c574d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Germann?= Date: Tue, 14 Dec 2021 17:59:03 +0100 Subject: [PATCH 2/9] Update .VERSION --- .VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.VERSION b/.VERSION index 9773998..b48862f 100644 --- a/.VERSION +++ b/.VERSION @@ -1 +1 @@ -v6.0.0 +v6.0.0-beta From d4a31e2629418d7ff9955ab2d9c11e099f31bca9 Mon Sep 17 00:00:00 2001 From: Thorsten Reichelt Date: Mon, 20 Dec 2021 19:02:54 +0100 Subject: [PATCH 3/9] added autoconfirm for upgrade Added autoconfirm for upgrade to fix issue https://github.com/buanet/ioBroker.docker/issues/228 --- debian/scripts/maintenance.sh | 48 +++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/debian/scripts/maintenance.sh b/debian/scripts/maintenance.sh index a02a60a..9089dbc 100644 --- a/debian/scripts/maintenance.sh +++ b/debian/scripts/maintenance.sh @@ -129,13 +129,43 @@ switch_off() { # upgrade js-controller upgrade() { - echo 'You are now going to upgrade your js-controller.' - echo 'As this will change data in /opt/iobroker, make sure you have a backup!' - echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' - echo 'Depending of the restart policy, you container will be stoped/ restarted automatically after the upgrade.' - read -p 'Do you want to continue [yes/no]? ' A - if [ "$A" == "y" ] || [ "$A" == "Y" ] || [ "$A" == "yes" ] - then + if [ "$autoconfirm" == "no" ] + then + echo 'You are now going to upgrade your js-controller.' + echo 'As this will change data in /opt/iobroker, make sure you have a backup!' + echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' + echo 'Depending of the restart policy, you container will be stoped/ restarted automatically after the upgrade.' + read -p 'Do you want to continue [yes/no]? ' A + if [ "$A" == "y" ] || [ "$A" == "Y" ] || [ "$A" == "yes" ] + then + echo 'Activating maintenance mode...' + echo "maintenance" > /opt/scripts/.docker_config/.healthcheck + sleep 1 + echo 'Done.' + echo 'Stopping ioBroker...' + pkill -u iobroker + sleep 1 + echo 'Done.' + echo 'Upgrading js-controller...' + iobroker update + iobroker upgrade self + sleep 1 + echo 'Done.' + echo 'Container will be stopped/ restarted in 5 seconds...' + sleep 5 + echo "stopping" > /opt/scripts/.docker_config/.healthcheck + pkill -u root + exit 0 + else + exit 0 + fi + elif [ "$autoconfirm" == "yes" ] + then + echo 'You are now going to upgrade your js-controller.' + echo 'As this will change data in /opt/iobroker, make sure you have a backup!' + echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' + echo 'Depending of the restart policy, you container will be stoped/ restarted automatically after the upgrade.' + echo 'This command was already confirmed by -y or --yes option.' echo 'Activating maintenance mode...' echo "maintenance" > /opt/scripts/.docker_config/.healthcheck sleep 1 @@ -154,8 +184,6 @@ upgrade() { echo "stopping" > /opt/scripts/.docker_config/.healthcheck pkill -u root exit 0 - else - exit 0 fi } @@ -218,4 +246,4 @@ for i in $reverse; do esac done -exit 0 \ No newline at end of file +exit 0 From 10624f62f8cd1d199175ee80856105153d258a95 Mon Sep 17 00:00:00 2001 From: buanet Date: Mon, 20 Dec 2021 22:46:10 +0100 Subject: [PATCH 4/9] fix typo --- src/README_docker_hub_buanet.md | 2 +- src/README_docker_hub_iobroker.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/README_docker_hub_buanet.md b/src/README_docker_hub_buanet.md index 878e550..f9a2eba 100644 --- a/src/README_docker_hub_buanet.md +++ b/src/README_docker_hub_buanet.md @@ -93,7 +93,7 @@ You could use environment variables to auto configure your ioBroker container on * `IOB_MULTIHOST`(optional) Sets ioBroker "master" or "slave" for multihost support (needs additional config for objectsdb and statesdb!) * `IOB_OBJECTSDB_HOST` (optional, default: 127.0.0.1) Sets host for ioBroker objects db * `IOB_OBJECTSDB_PORT` (optional, default: 9001) Sets port for ioBroker objects db -* `IOB_OBJECTSDB_TYPE` (optional, default: file) Sets type of ioBroker objects db, cloud be "file" or "redis" ([not officially supported](https://github.com/ioBroker/ioBroker#databases)). +* `IOB_OBJECTSDB_TYPE` (optional, default: file) Sets type of ioBroker objects db, could be "file" or "redis" ([not officially supported](https://github.com/ioBroker/ioBroker#databases)). * `IOB_STATESDB_HOST` (optional, default: 127.0.0.1) Sets host for ioBroker states db * `IOB_STATESDB_PORT` (optional, default: 9000) Sets port for ioBroker states db * `IOB_STATESDB_TYPE` (optional, default: file) Sets type of ioBroker states db, could be "file" or "redis" diff --git a/src/README_docker_hub_iobroker.md b/src/README_docker_hub_iobroker.md index 9dd114b..cca5e50 100644 --- a/src/README_docker_hub_iobroker.md +++ b/src/README_docker_hub_iobroker.md @@ -94,7 +94,7 @@ You could use environment variables to auto configure your ioBroker container on * `IOB_MULTIHOST`(optional) Sets ioBroker "master" or "slave" for multihost support (needs additional config for objectsdb and statesdb!) * `IOB_OBJECTSDB_HOST` (optional, default: 127.0.0.1) Sets host for ioBroker objects db * `IOB_OBJECTSDB_PORT` (optional, default: 9001) Sets port for ioBroker objects db -* `IOB_OBJECTSDB_TYPE` (optional, default: file) Sets type of ioBroker objects db, cloud be "file" or "redis" ([not officially supported](https://github.com/ioBroker/ioBroker#databases)). +* `IOB_OBJECTSDB_TYPE` (optional, default: file) Sets type of ioBroker objects db, could be "file" or "redis" ([not officially supported](https://github.com/ioBroker/ioBroker#databases)). * `IOB_STATESDB_HOST` (optional, default: 127.0.0.1) Sets host for ioBroker states db * `IOB_STATESDB_PORT` (optional, default: 9000) Sets port for ioBroker states db * `IOB_STATESDB_TYPE` (optional, default: file) Sets type of ioBroker states db, could be "file" or "redis" From c22873c7bff353350f5c173595a89bc8578c202f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Germann?= Date: Mon, 20 Dec 2021 23:15:50 +0100 Subject: [PATCH 5/9] Update CHANGELOG.md --- CHANGELOG.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b0ea08..75349f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Changelog -### v6.1.0-beta.1 (2021-12-14) +### v6.1.0-beta.1 (2021-12-20) +* added autoconfirm parameter to upgrade function in maintenance script ([#229 @thost96](https://github.com/buanet/ioBroker.docker/pull/229)) * added alias "m" for maintenance script ### v6.0.0 (2021-12-09) @@ -10,7 +11,7 @@ * adding beta-node16 tag for beta testing node16 * updating documentation * v5.3.0-beta1 (2021-10-07) - * adding check (installed) PACKAGES on startup (#201) + * adding check (installed) PACKAGES on startup (fixes [#201](https://github.com/buanet/ioBroker.docker/issues/201)) * adding packages for discovery adapter * adding packages for backitup adapter * reorganizing Dockerfile @@ -36,7 +37,7 @@ * removing couchdb option for states db (no longer supported) * v5.2.0-beta1 (2021-05-04) * added upgrade parameter to maintenance script - * added expose for default admin ui port (#172) + * added expose for default admin ui port (fixes [#172](https://github.com/buanet/ioBroker.docker/issues/172)) * added short form for maintenance script * v5.2.0-beta (2021-04-02) * some renaming to optimize automated build @@ -87,7 +88,7 @@ ### v4.1.0 (2020-01-17) * improved readme.md * v4.0.3-beta (2020-01-06) - * added support to restore backup on startup + * added support to restore backup on startup ([#56 @duffbeer2000](https://github.com/buanet/ioBroker.docker/pull/56)) * small fixes according to "docker best practices" * v4.0.2-beta (2019-12-10) * ~~added env for activating redis~~ @@ -107,13 +108,13 @@ * v3.1.2-beta (2019-09-03) * using node 10 instead of node 8 * v3.1.1-beta (2019-09-02) - * adding env for setting uid/ gid for iobroker-user + * adding env for setting uid/ gid for iobroker-user ([#33 @mplogas](https://github.com/buanet/ioBroker.docker/pull/33)) ### v3.1.0 (2019-08-21) * v3.0.3-beta (2019-08-21) * switching base image from "debian:latest" to "debian:stretch" * v3.0.2-beta (2019-06-13) - * using gosu instead of sudo + * using gosu instead of sudo ([#26 @SchumyHao](https://github.com/buanet/ioBroker.docker/pull/26)) * changing output of ioBroker logging * v3.0.1-beta (2019-05-18) * ~~switching back to iobroker-daemon for startup~~ From c70f27151ed028b8b8bee6a99cc31cd9e6e505d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Dec 2021 09:20:16 +0000 Subject: [PATCH 6/9] Bump docker/login-action from 1.10.0 to 1.12.0 Bumps [docker/login-action](https://github.com/docker/login-action) from 1.10.0 to 1.12.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v1.10.0...v1.12.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/build-debian-image-beta-node16.yml | 4 ++-- .github/workflows/build-debian-image-beta.yml | 4 ++-- .github/workflows/build-debian-image-dev-node16.yml | 4 ++-- .github/workflows/build-debian-image-dev.yml | 4 ++-- .github/workflows/build-debian-image-main.yml | 4 ++-- .github/workflows/build-debian-image-main_iob.yml | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-debian-image-beta-node16.yml b/.github/workflows/build-debian-image-beta-node16.yml index 1b4b693..1ebfc28 100644 --- a/.github/workflows/build-debian-image-beta-node16.yml +++ b/.github/workflows/build-debian-image-beta-node16.yml @@ -53,13 +53,13 @@ jobs: uses: docker/setup-buildx-action@v1.6.0 - name: Login to DockerHub - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Login to GitHub Container Registry - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: registry: ghcr.io username: ${{ secrets.PACKAGES_USER }} diff --git a/.github/workflows/build-debian-image-beta.yml b/.github/workflows/build-debian-image-beta.yml index fcf8c6d..a0725ee 100644 --- a/.github/workflows/build-debian-image-beta.yml +++ b/.github/workflows/build-debian-image-beta.yml @@ -53,13 +53,13 @@ jobs: uses: docker/setup-buildx-action@v1.6.0 - name: Login to DockerHub - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Login to GitHub Container Registry - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: registry: ghcr.io username: ${{ secrets.PACKAGES_USER }} diff --git a/.github/workflows/build-debian-image-dev-node16.yml b/.github/workflows/build-debian-image-dev-node16.yml index 9f95ad6..f62bd3f 100644 --- a/.github/workflows/build-debian-image-dev-node16.yml +++ b/.github/workflows/build-debian-image-dev-node16.yml @@ -49,13 +49,13 @@ jobs: uses: docker/setup-buildx-action@v1.6.0 - name: Login to DockerHub - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Login to GitHub Container Registry - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: registry: ghcr.io username: ${{ secrets.PACKAGES_USER }} diff --git a/.github/workflows/build-debian-image-dev.yml b/.github/workflows/build-debian-image-dev.yml index f87ad18..98dd0d2 100644 --- a/.github/workflows/build-debian-image-dev.yml +++ b/.github/workflows/build-debian-image-dev.yml @@ -49,13 +49,13 @@ jobs: uses: docker/setup-buildx-action@v1.6.0 - name: Login to DockerHub - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Login to GitHub Container Registry - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: registry: ghcr.io username: ${{ secrets.PACKAGES_USER }} diff --git a/.github/workflows/build-debian-image-main.yml b/.github/workflows/build-debian-image-main.yml index a16cc5b..e0601a1 100644 --- a/.github/workflows/build-debian-image-main.yml +++ b/.github/workflows/build-debian-image-main.yml @@ -51,13 +51,13 @@ jobs: uses: docker/setup-buildx-action@v1.6.0 - name: Login to DockerHub (buanet) - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Login to GitHub Container Registry - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: registry: ghcr.io username: ${{ secrets.PACKAGES_USER }} diff --git a/.github/workflows/build-debian-image-main_iob.yml b/.github/workflows/build-debian-image-main_iob.yml index 3523d7d..73d91fd 100644 --- a/.github/workflows/build-debian-image-main_iob.yml +++ b/.github/workflows/build-debian-image-main_iob.yml @@ -51,7 +51,7 @@ jobs: uses: docker/setup-buildx-action@v1.6.0 - name: Login to DockerHub (iobroker) - uses: docker/login-action@v1.10.0 + uses: docker/login-action@v1.12.0 with: username: ${{ secrets.DOCKER_USER_IOB }} password: ${{ secrets.DOCKER_PASS_IOB }} From e20f66ada682545db195e90079d20bfd3a99f617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Germann?= Date: Mon, 20 Dec 2021 23:15:50 +0100 Subject: [PATCH 7/9] Update CHANGELOG.md --- debian/scripts/maintenance.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/debian/scripts/maintenance.sh b/debian/scripts/maintenance.sh index 37bfe9d..de3e5ab 100644 --- a/debian/scripts/maintenance.sh +++ b/debian/scripts/maintenance.sh @@ -21,10 +21,10 @@ display_help() { echo '' echo "COMMANDS" echo "------------------" - echo " status > gives the current state of maintenance mode" + echo " status > reports the current state of maintenance mode" echo " on > switches mantenance mode ON" - echo " off > switches mantenance mode OFF and shuts down/ restarts container" - echo " upgrade > will put container to maintenance mode and upgrade iobroker" + echo " off > switches mantenance mode OFF and shuts down or restarts container" + echo " upgrade > will put container to maintenance mode and upgrade ioBroker" echo " help > shows this help" echo '' echo "OPTIONS" @@ -101,11 +101,11 @@ switch_off() { if [ $(cat /opt/scripts/.docker_config/.healthcheck) == 'maintenance' ] && [ "$autoconfirm" == "no" ] # maintenance mode ON / autoconfirm = no then echo 'You are now going to deactivate maintenance mode for this container.' - echo 'Depending on the restart policy, your container will be stopped/ restarted immediately.' + echo 'Depending on the restart policy, your container will be stopped or restarted immediately.' read -p 'Do you want to continue [yes/no]? ' A if [ "$A" == "y" ] || [ "$A" == "Y" ] || [ "$A" == "yes" ] then - echo 'Deactivating maintenance mode and forcing container to stop/ restart...' + echo 'Deactivating maintenance mode and forcing container to stop or restart...' echo "stopping" > /opt/scripts/.docker_config/.healthcheck pkill -u root echo 'Done.' @@ -116,9 +116,9 @@ switch_off() { elif [ $(cat /opt/scripts/.docker_config/.healthcheck) == 'maintenance' ] && [ "$autoconfirm" == "yes" ] # maintenance mode ON / autoconfirm = yes then echo 'You are now going to deactivate maintenance mode for this container.' - echo 'Depending on the restart policy, your container will be stopped/ restarted immediately.' + echo 'Depending on the restart policy, your container will be stopped or restarted immediately.' echo 'This command was already confirmed by -y or --yes option.' - echo 'Deactivating maintenance mode and forcing container to stop/ restart...' + echo 'Deactivating maintenance mode and forcing container to stop or restart...' echo "stopping" > /opt/scripts/.docker_config/.healthcheck pkill -u root echo 'Done.' @@ -135,7 +135,7 @@ upgrade() { echo 'You are now going to upgrade your js-controller.' echo 'As this will change data in /opt/iobroker, make sure you have a backup!' echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' - echo 'Depending of the restart policy, you container will be stoped/ restarted automatically after the upgrade.' + echo 'Depending of the restart policy, your container will be stopped or restarted automatically after the upgrade.' read -p 'Do you want to continue [yes/no]? ' A if [ "$A" == "y" ] || [ "$A" == "Y" ] || [ "$A" == "yes" ] then @@ -152,7 +152,7 @@ upgrade() { iobroker upgrade self sleep 1 echo 'Done.' - echo 'Container will be stopped/ restarted in 5 seconds...' + echo 'Container will be stopped or restarted in 5 seconds...' sleep 5 echo "stopping" > /opt/scripts/.docker_config/.healthcheck pkill -u root @@ -165,7 +165,7 @@ upgrade() { echo 'You are now going to upgrade your js-controller.' echo 'As this will change data in /opt/iobroker, make sure you have a backup!' echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' - echo 'Depending of the restart policy, you container will be stoped/ restarted automatically after the upgrade.' + echo 'Depending of the restart policy, your container will be stopped or restarted automatically after the upgrade.' echo 'This command was already confirmed by -y or --yes option.' echo 'Activating maintenance mode...' echo "maintenance" > /opt/scripts/.docker_config/.healthcheck @@ -180,7 +180,7 @@ upgrade() { iobroker upgrade self sleep 1 echo 'Done.' - echo 'Container will be stopped/ restarted in 5 seconds...' + echo 'Container will be stopped or restarted in 5 seconds...' sleep 5 echo "stopping" > /opt/scripts/.docker_config/.healthcheck pkill -u root From 6ccf196ae29b81a5191b149fda9eedc6763a4235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Gro=C3=9F?= Date: Thu, 23 Dec 2021 17:34:38 +0100 Subject: [PATCH 8/9] Whitespace fixes --- debian/scripts/maintenance.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/scripts/maintenance.sh b/debian/scripts/maintenance.sh index de3e5ab..3b81aa8 100644 --- a/debian/scripts/maintenance.sh +++ b/debian/scripts/maintenance.sh @@ -30,8 +30,8 @@ display_help() { echo "OPTIONS" echo "------------------" echo " -y|--yes > confirms the used command without asking" - echo " -h|--help > shows this help" - echo '' + echo " -h|--help > shows this help" + echo '' exit 0 } @@ -131,7 +131,7 @@ switch_off() { # upgrade js-controller upgrade() { if [ "$autoconfirm" == "no" ] - then + then echo 'You are now going to upgrade your js-controller.' echo 'As this will change data in /opt/iobroker, make sure you have a backup!' echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' @@ -161,8 +161,8 @@ upgrade() { exit 0 fi elif [ "$autoconfirm" == "yes" ] - then - echo 'You are now going to upgrade your js-controller.' + then + echo 'You are now going to upgrade your js-controller.' echo 'As this will change data in /opt/iobroker, make sure you have a backup!' echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' echo 'Depending of the restart policy, your container will be stopped or restarted automatically after the upgrade.' @@ -198,7 +198,7 @@ for i in "$@"; do reverse="$i $reverse" done -# checking the arguments +# checking the arguments for i in $reverse; do case $i in help|-h|--help) From 296ff3c61275cad60369e652cf20941bf1492af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Gro=C3=9F?= Date: Thu, 23 Dec 2021 17:39:05 +0100 Subject: [PATCH 9/9] Deduplicate upgrade code paths with or without --yes option --- debian/scripts/maintenance.sh | 69 +++++++++++++---------------------- 1 file changed, 25 insertions(+), 44 deletions(-) diff --git a/debian/scripts/maintenance.sh b/debian/scripts/maintenance.sh index 3b81aa8..11aa914 100644 --- a/debian/scripts/maintenance.sh +++ b/debian/scripts/maintenance.sh @@ -130,62 +130,43 @@ switch_off() { # upgrade js-controller upgrade() { + echo 'You are now going to upgrade your js-controller.' + echo 'As this will change data in /opt/iobroker, make sure you have a backup!' + echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' + echo 'Depending of the restart policy, your container will be stopped or restarted automatically after the upgrade.' + if [ "$autoconfirm" == "no" ] then - echo 'You are now going to upgrade your js-controller.' - echo 'As this will change data in /opt/iobroker, make sure you have a backup!' - echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' - echo 'Depending of the restart policy, your container will be stopped or restarted automatically after the upgrade.' read -p 'Do you want to continue [yes/no]? ' A if [ "$A" == "y" ] || [ "$A" == "Y" ] || [ "$A" == "yes" ] then - echo 'Activating maintenance mode...' - echo "maintenance" > /opt/scripts/.docker_config/.healthcheck - sleep 1 - echo 'Done.' - echo 'Stopping ioBroker...' - pkill -u iobroker - sleep 1 - echo 'Done.' - echo 'Upgrading js-controller...' - iobroker update - iobroker upgrade self - sleep 1 - echo 'Done.' - echo 'Container will be stopped or restarted in 5 seconds...' - sleep 5 - echo "stopping" > /opt/scripts/.docker_config/.healthcheck - pkill -u root - exit 0 + : # Continue. else exit 0 fi elif [ "$autoconfirm" == "yes" ] then - echo 'You are now going to upgrade your js-controller.' - echo 'As this will change data in /opt/iobroker, make sure you have a backup!' - echo 'During the upgrade process the container will automatically switch into maintenance mode and stop ioBroker.' - echo 'Depending of the restart policy, your container will be stopped or restarted automatically after the upgrade.' echo 'This command was already confirmed by -y or --yes option.' - echo 'Activating maintenance mode...' - echo "maintenance" > /opt/scripts/.docker_config/.healthcheck - sleep 1 - echo 'Done.' - echo 'Stopping ioBroker...' - pkill -u iobroker - sleep 1 - echo 'Done.' - echo 'Upgrading js-controller...' - iobroker update - iobroker upgrade self - sleep 1 - echo 'Done.' - echo 'Container will be stopped or restarted in 5 seconds...' - sleep 5 - echo "stopping" > /opt/scripts/.docker_config/.healthcheck - pkill -u root - exit 0 fi + + echo 'Activating maintenance mode...' + echo "maintenance" > /opt/scripts/.docker_config/.healthcheck + sleep 1 + echo 'Done.' + echo 'Stopping ioBroker...' + pkill -u iobroker + sleep 1 + echo 'Done.' + echo 'Upgrading js-controller...' + iobroker update + iobroker upgrade self + sleep 1 + echo 'Done.' + echo 'Container will be stopped or restarted in 5 seconds...' + sleep 5 + echo "stopping" > /opt/scripts/.docker_config/.healthcheck + pkill -u root + exit 0 } ########################################