Merge pull request #1926 from danez/healthcheck-pg

Add healthcheckscript for postgres
This commit is contained in:
Alexandre
2025-06-24 13:32:43 +02:00
committed by GitHub
7 changed files with 25 additions and 3 deletions

View File

@@ -1,3 +1,7 @@
## 15.7-47 (24-06-2025)
- Fix healthcheck to run with correct user and database
## 15.7-46 (23-06-2025)
- Version 45 was erroneous : you need to restore prior to version 45 then update to 46 again. If you don't have a backup please create an issue in the github repo

View File

@@ -121,4 +121,4 @@ HEALTHCHECK \
--retries=5 \
--start-period=90s \
--timeout=25s \
CMD pg_isready --dbname="${POSTGRES_DB}" --username="${POSTGRES_USER}" || exit 1
CMD /usr/local/bin/healthcheck.sh

View File

@@ -32,5 +32,5 @@
"slug": "postgres",
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/postgres",
"version": "15.7-46"
"version": "15.7-47"
}

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
POSTGRES_USER="$(bashio::config "POSTGRES_USER" "postgres")"
POSTGRES_DB="$(bashio::config "POSTGRES_DB" "$POSTGRES_USER")"
pg_isready --dbname="${POSTGRES_DB}" --username="${POSTGRES_USER}" || exit $?;

View File

@@ -1,3 +1,7 @@
## 17.4-9 (24-06-2025)
- Fix healthcheck to run with correct user and database
## 17.4-8 (23-06-2025)
- Version 5, 6 and 7 had an issue : you need to restore prior to version 45 then update to 46 again. If you don't have a backup please create an issue in the github repo

View File

@@ -32,5 +32,5 @@
"slug": "postgres_latest",
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/postgres",
"version": "17.4-8"
"version": "17.4-9"
}

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
POSTGRES_USER="$(bashio::config "POSTGRES_USER" "postgres")"
POSTGRES_DB="$(bashio::config "POSTGRES_DB" "$POSTGRES_USER")"
pg_isready --dbname="${POSTGRES_DB}" --username="${POSTGRES_USER}" || exit $?;