mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-18 19:09:02 +02:00
Compare commits
15 Commits
v8.1.0-bet
...
v8.1.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fe9c10771 | ||
|
|
3d83c7fa21 | ||
|
|
f225536852 | ||
|
|
18b0f863bd | ||
|
|
ff6535a896 | ||
|
|
3543b10c90 | ||
|
|
b3870bdcb7 | ||
|
|
9f016f5363 | ||
|
|
800e95a5c2 | ||
|
|
0f3b59fe98 | ||
|
|
8f7f9656d8 | ||
|
|
7e291f98ea | ||
|
|
a46e29fac1 | ||
|
|
8294f8cf51 | ||
|
|
5c7dfb3d3c |
2
.github/dependencies/.backitup-version
vendored
2
.github/dependencies/.backitup-version
vendored
@@ -1 +1 @@
|
|||||||
2.6.16
|
2.6.23
|
||||||
|
|||||||
@@ -39,37 +39,42 @@ jobs:
|
|||||||
mv -f ./debian/node20/Dockerfile.tmp ./debian/node20/Dockerfile
|
mv -f ./debian/node20/Dockerfile.tmp ./debian/node20/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build Docker image (node20)
|
- name: Build Docker image (node20)
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node20/Dockerfile
|
file: ./debian/node20/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm/v7
|
||||||
|
linux/arm64/v8
|
||||||
tags: |
|
tags: |
|
||||||
buanet/iobroker:beta-node20,
|
buanet/iobroker:beta-node20,
|
||||||
buanet/iobroker:${{ env.version }}-node20,
|
buanet/iobroker:${{ env.version }}-node20,
|
||||||
ghcr.io/buanet/iobroker:beta-node20,
|
ghcr.io/buanet/iobroker:beta-node20,
|
||||||
ghcr.io/buanet/iobroker:${{ env.version }}-node20
|
ghcr.io/buanet/iobroker:${{ env.version }}-node20
|
||||||
|
provenance: false
|
||||||
|
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net)
|
||||||
|
|
||||||
- name: Delete untagged images from GitHub packages
|
- name: Delete untagged images from GitHub packages
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
|
|||||||
10
.github/workflows/build-debian-image-beta.yml
vendored
10
.github/workflows/build-debian-image-beta.yml
vendored
@@ -39,27 +39,27 @@ jobs:
|
|||||||
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node18/Dockerfile
|
file: ./debian/node18/Dockerfile
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3.5.0
|
||||||
with:
|
with:
|
||||||
repository: 'buanet/ioBroker.docker'
|
repository: 'buanet/ioBroker.docker'
|
||||||
|
|
||||||
- name: Fetching version tag and date
|
- name: Fetch version tag and date
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION="$(cat .VERSION)"
|
VERSION="$(cat .VERSION)"
|
||||||
@@ -33,38 +33,43 @@ jobs:
|
|||||||
mv -f ./debian/node20/Dockerfile.tmp ./debian/node20/Dockerfile
|
mv -f ./debian/node20/Dockerfile.tmp ./debian/node20/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build Docker image (node20)
|
- name: Build Docker image (node20)
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node20/Dockerfile
|
file: ./debian/node20/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm/v7
|
||||||
|
linux/arm64/v8
|
||||||
tags: |
|
tags: |
|
||||||
buanet/iobroker:dev-node20,
|
buanet/iobroker:dev-node20,
|
||||||
ghcr.io/buanet/iobroker:dev-node20
|
ghcr.io/buanet/iobroker:dev-node20
|
||||||
|
provenance: false
|
||||||
|
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net)
|
||||||
|
|
||||||
- name: Delete untagged images from GitHub packages
|
- name: Delete untagged images from GitHub Container Registry
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6.4.1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.PACKAGES_PASS }}
|
github-token: ${{ secrets.PACKAGES_PASS }}
|
||||||
script: |
|
script: |
|
||||||
|
|||||||
10
.github/workflows/build-debian-image-dev.yml
vendored
10
.github/workflows/build-debian-image-dev.yml
vendored
@@ -33,27 +33,27 @@ jobs:
|
|||||||
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node18/Dockerfile
|
file: ./debian/node18/Dockerfile
|
||||||
|
|||||||
@@ -42,20 +42,20 @@ jobs:
|
|||||||
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub (iobroker)
|
- name: Login to DockerHub (iobroker)
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER_IOB }}
|
username: ${{ secrets.DOCKER_USER_IOB }}
|
||||||
password: ${{ secrets.DOCKER_PASS_IOB }}
|
password: ${{ secrets.DOCKER_PASS_IOB }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node18/Dockerfile
|
file: ./debian/node18/Dockerfile
|
||||||
|
|||||||
10
.github/workflows/build-debian-image-latest.yml
vendored
10
.github/workflows/build-debian-image-latest.yml
vendored
@@ -42,26 +42,26 @@ jobs:
|
|||||||
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
- name: Login to DockerHub (buanet)
|
- name: Login to DockerHub (buanet)
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node18/Dockerfile
|
file: ./debian/node18/Dockerfile
|
||||||
|
|||||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,8 +1,14 @@
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
### v8.1.0-beta.2 (coming soon)
|
### v8.1.0-beta.3 (05.07.2023)
|
||||||
* prohibit restore when startup script is still running
|
* fix permission issue for restart container as iobroker user
|
||||||
* extend time before restart after restore is done
|
* fix issue with js-controller ui upgrade
|
||||||
|
* fix small issues in maintenance script
|
||||||
|
* update action workflows
|
||||||
|
* v8.1.0-beta.2 (26.04.2023)
|
||||||
|
* prohibit restore when startup script is still running
|
||||||
|
* extend time before restart after restore is done
|
||||||
|
* influx data repo will be added automatically when PACKAGES contains influxdb or influxdb2-cli package
|
||||||
* v8.1.0-beta.1 (14.04.2023)
|
* v8.1.0-beta.1 (14.04.2023)
|
||||||
* enhance github actions
|
* enhance github actions
|
||||||
* enhance log output of maintenance script on restore ([#333](https://github.com/buanet/ioBroker.docker/issues/333))
|
* enhance log output of maintenance script on restore ([#333](https://github.com/buanet/ioBroker.docker/issues/333))
|
||||||
|
|||||||
102
debian/node20/Dockerfile
vendored
Normal file
102
debian/node20/Dockerfile
vendored
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.title="Official ioBroker Docker Image" \
|
||||||
|
org.opencontainers.image.description="Official Docker image for ioBroker smarthome software (https://www.iobroker.net)" \
|
||||||
|
org.opencontainers.image.documentation="https://github.com/buanet/ioBroker.docker#readme" \
|
||||||
|
org.opencontainers.image.authors="André Germann <info@buanet.de>" \
|
||||||
|
org.opencontainers.image.url="https://github.com/buanet/ioBroker.docker" \
|
||||||
|
org.opencontainers.image.source="https://github.com/buanet/ioBroker.docker" \
|
||||||
|
org.opencontainers.image.base.name="docker.io/library/debian:bullseye-slim" \
|
||||||
|
org.opencontainers.image.version="${VERSION}" \
|
||||||
|
org.opencontainers.image.created="${DATI}"
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
|
# Copy scripts
|
||||||
|
COPY scripts /opt/scripts
|
||||||
|
COPY userscripts /opt/userscripts
|
||||||
|
|
||||||
|
# Install prerequisites (including node) and generating locales
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
|
cifs-utils \
|
||||||
|
curl \
|
||||||
|
gosu \
|
||||||
|
iputils-ping \
|
||||||
|
jq \
|
||||||
|
locales \
|
||||||
|
nfs-common \
|
||||||
|
procps \
|
||||||
|
python3 \
|
||||||
|
python3-dev \
|
||||||
|
sudo \
|
||||||
|
tar \
|
||||||
|
tzdata \
|
||||||
|
udev \
|
||||||
|
wget \
|
||||||
|
# Install node
|
||||||
|
&& curl -sL https://deb.nodesource.com/setup_20.x | bash \
|
||||||
|
&& apt-get update && apt-get install -y nodejs \
|
||||||
|
# Install node-gyp
|
||||||
|
&& npm install -g node-gyp \
|
||||||
|
# Generating locales
|
||||||
|
&& sed -i 's/^# *\(de_DE.UTF-8\)/\1/' /etc/locale.gen \
|
||||||
|
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
|
||||||
|
&& locale-gen \
|
||||||
|
# Change permissions for scripts
|
||||||
|
&& chmod 777 /opt/scripts/ \
|
||||||
|
&& chmod 777 /opt/userscripts/ \
|
||||||
|
&& chmod +x /opt/scripts/*.sh \
|
||||||
|
&& chmod +x /opt/userscripts/*.sh \
|
||||||
|
# Prepare
|
||||||
|
&& mkdir -p /opt/scripts/.docker_config/ \
|
||||||
|
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \
|
||||||
|
&& echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker \
|
||||||
|
&& echo "true" > /opt/.first_run \
|
||||||
|
# Run installer
|
||||||
|
&& curl -sL https://iobroker.net/install.sh | bash - \
|
||||||
|
# Deleting UUID from build
|
||||||
|
&& iobroker unsetup -y \
|
||||||
|
&& echo "true" > /opt/iobroker/.fresh_install \
|
||||||
|
# Backup initial ioBroker and userscript folder
|
||||||
|
&& tar -cf /opt/initial_iobroker.tar /opt/iobroker \
|
||||||
|
&& tar -cf /opt/initial_userscripts.tar /opt/userscripts \
|
||||||
|
# Setting up iobroker-user (shell, home dir and rights)
|
||||||
|
&& chsh -s /bin/bash iobroker \
|
||||||
|
&& usermod --home /opt/iobroker iobroker \
|
||||||
|
&& usermod -u 1000 iobroker \
|
||||||
|
&& groupmod -g 1000 iobroker \
|
||||||
|
&& chown root:iobroker /usr/sbin/gosu \
|
||||||
|
&& chmod +s /usr/sbin/gosu \
|
||||||
|
# Clean up installation cache
|
||||||
|
&& apt-get autoclean -y \
|
||||||
|
&& apt-get autoremove \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /tmp/* /var/tmp/* \
|
||||||
|
&& rm -rf /root/.cache/* /root/.npm/* \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Setting up default ENVs
|
||||||
|
ENV DEBIAN_FRONTEND="teletype" \
|
||||||
|
LANG="de_DE.UTF-8" \
|
||||||
|
LANGUAGE="de_DE:de" \
|
||||||
|
LC_ALL="de_DE.UTF-8" \
|
||||||
|
SETGID=1000 \
|
||||||
|
SETUID=1000 \
|
||||||
|
TZ="Europe/Berlin"
|
||||||
|
|
||||||
|
# Expose default admin ui port
|
||||||
|
EXPOSE 8081
|
||||||
|
|
||||||
|
# Change work dir
|
||||||
|
WORKDIR /opt/iobroker/
|
||||||
|
|
||||||
|
# Healthcheck
|
||||||
|
HEALTHCHECK --interval=15s --timeout=5s --retries=5 \
|
||||||
|
CMD ["/bin/bash", "-c", "/opt/scripts/healthcheck.sh"]
|
||||||
|
|
||||||
|
# Volumes for persistent data
|
||||||
|
VOLUME ["/opt/iobroker"]
|
||||||
|
|
||||||
|
# Run startup-script
|
||||||
|
ENTRYPOINT ["/bin/bash", "-c", "/opt/scripts/iobroker_startup.sh"]
|
||||||
50
debian/scripts/maintenance.sh
vendored
50
debian/scripts/maintenance.sh
vendored
@@ -59,23 +59,9 @@ enable_maintenance() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$killbyname" == yes ]]; then
|
|
||||||
# undocumented option, only for use with backitup restore scripts
|
|
||||||
# stops iobroker by terminating js-controller process by name (the old way)
|
|
||||||
echo 'This command will activate maintenance mode and stop js-controller.'
|
|
||||||
echo 'Activating maintenance mode...'
|
|
||||||
echo 'maintenance' > "$healthcheck"
|
|
||||||
sleep 1
|
|
||||||
echo 'Done.'
|
|
||||||
echo -n 'Stopping ioBroker...'
|
|
||||||
pkill -u iobroker -f iobroker.js-controller
|
|
||||||
sleep 5
|
|
||||||
echo 'Done.'
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 'You are now going to stop ioBroker and activate maintenance mode for this container.'
|
echo 'You are now going to stop ioBroker and activate maintenance mode for this container.'
|
||||||
|
|
||||||
|
if [[ "$killbyname" != yes ]]; then
|
||||||
if [[ "$autoconfirm" != yes ]]; then
|
if [[ "$autoconfirm" != yes ]]; then
|
||||||
local reply
|
local reply
|
||||||
|
|
||||||
@@ -85,14 +71,12 @@ enable_maintenance() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
fi
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Activating maintenance mode...'
|
echo 'Activating maintenance mode...'
|
||||||
echo 'maintenance' > "$healthcheck"
|
echo 'maintenance' > "$healthcheck"
|
||||||
sleep 1
|
sleep 1
|
||||||
echo 'Done.'
|
|
||||||
echo -n 'Stopping ioBroker...'
|
echo -n 'Stopping ioBroker...'
|
||||||
stop_iob
|
stop_iob
|
||||||
}
|
}
|
||||||
@@ -116,13 +100,11 @@ disable_maintenance() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Deactivating maintenance mode and forcing container to stop or restart...'
|
echo 'Deactivating maintenance mode and forcing container to stop or restart...'
|
||||||
echo 'stopping' > "$healthcheck"
|
echo 'stopping' > "$healthcheck"
|
||||||
pkill -u root
|
gosu root pkill -u root
|
||||||
echo 'Done.'
|
echo 'Done.'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,8 +124,6 @@ upgrade_jscontroller() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! maintenance_enabled > /dev/null; then
|
if ! maintenance_enabled > /dev/null; then
|
||||||
@@ -161,7 +141,7 @@ upgrade_jscontroller() {
|
|||||||
echo 'Container will be stopped or restarted in 5 seconds...'
|
echo 'Container will be stopped or restarted in 5 seconds...'
|
||||||
sleep 5
|
sleep 5
|
||||||
echo 'stopping' > "$healthcheck"
|
echo 'stopping' > "$healthcheck"
|
||||||
pkill -u root
|
gosu root pkill -u root
|
||||||
}
|
}
|
||||||
|
|
||||||
# stop iobroker and wait until all processes stopped or pkill_timeout is reached
|
# stop iobroker and wait until all processes stopped or pkill_timeout is reached
|
||||||
@@ -169,16 +149,19 @@ stop_iob() {
|
|||||||
local status timeout
|
local status timeout
|
||||||
|
|
||||||
timeout="$(date --date="now + $pkill_timeout sec" +%s)"
|
timeout="$(date --date="now + $pkill_timeout sec" +%s)"
|
||||||
pkill -u iobroker -f iobroker.js-controller
|
pkill -u iobroker -f 'iobroker.js-controller[^/]*$'
|
||||||
status=$?
|
status=$?
|
||||||
if (( status >= 2 )); then # syntax error or fatal error
|
if (( status >= 2 )); then # syntax error or fatal error
|
||||||
|
echo 'fatal error' #for logging
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( status == 1 )); then # no processes matched
|
if (( status == 1 )); then # no processes matched
|
||||||
|
echo 'no process matched' #for logging
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$killbyname" != yes ]]; then
|
||||||
# pgrep exits with status 1 when there are no matches
|
# pgrep exits with status 1 when there are no matches
|
||||||
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
|
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
|
||||||
if (($(date +%s) > timeout)); then
|
if (($(date +%s) > timeout)); then
|
||||||
@@ -188,10 +171,15 @@ stop_iob() {
|
|||||||
echo 'Done.'
|
echo 'Done.'
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n '.'
|
echo -n '.'
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
else
|
||||||
|
for ((i=0; i<3; i++)); do
|
||||||
|
sleep 1
|
||||||
|
echo -n '.'
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e '\nDone.'
|
echo -e '\nDone.'
|
||||||
}
|
}
|
||||||
@@ -210,17 +198,17 @@ restart_container() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! maintenance_enabled > /dev/null; then
|
||||||
echo -n 'Stopping ioBroker...'
|
echo -n 'Stopping ioBroker...'
|
||||||
stop_iob
|
stop_iob
|
||||||
|
fi
|
||||||
|
|
||||||
echo 'Container will be stopped or restarted in 5 seconds...'
|
echo 'Container will be stopped or restarted in 5 seconds...'
|
||||||
sleep 5
|
sleep 5
|
||||||
echo 'stopping' > "$healthcheck"
|
echo 'stopping' > "$healthcheck"
|
||||||
pkill -u root
|
gosu root pkill -u root
|
||||||
}
|
}
|
||||||
|
|
||||||
# restore iobroker
|
# restore iobroker
|
||||||
@@ -238,8 +226,6 @@ restore_iobroker() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if check_starting > /dev/null; then
|
if check_starting > /dev/null; then
|
||||||
@@ -279,7 +265,7 @@ restore_iobroker() {
|
|||||||
echo 'Container will be stopped or restarted in 10 seconds...'
|
echo 'Container will be stopped or restarted in 10 seconds...'
|
||||||
sleep 10
|
sleep 10
|
||||||
echo 'stopping' > "$healthcheck"
|
echo 'stopping' > "$healthcheck"
|
||||||
pkill -u root
|
gosu root pkill -u root
|
||||||
}
|
}
|
||||||
|
|
||||||
# parsing commands and options
|
# parsing commands and options
|
||||||
|
|||||||
Reference in New Issue
Block a user