attempting to fix frozen deploy step
This commit is contained in:
@@ -4,6 +4,7 @@ set -euo pipefail
|
||||
VOLUME_NAME="${PROD_DB_VOLUME_NAME:-skymoney_pgdata}"
|
||||
ALLOW_EMPTY="${ALLOW_EMPTY_PROD_VOLUME:-0}"
|
||||
DOCKER_CMD="${DOCKER_CMD:-docker}"
|
||||
PROBE_TIMEOUT_SEC="${PROD_VOLUME_GUARD_TIMEOUT_SEC:-20}"
|
||||
|
||||
if ! $DOCKER_CMD volume inspect "$VOLUME_NAME" >/dev/null 2>&1; then
|
||||
if [[ "$ALLOW_EMPTY" == "1" ]]; then
|
||||
@@ -16,7 +17,7 @@ if ! $DOCKER_CMD volume inspect "$VOLUME_NAME" >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if $DOCKER_CMD run --rm -v "${VOLUME_NAME}:/var/lib/postgresql/data" alpine sh -lc "test -f /var/lib/postgresql/data/PG_VERSION"; then
|
||||
if timeout "${PROBE_TIMEOUT_SEC}"s $DOCKER_CMD run --rm -v "${VOLUME_NAME}:/var/lib/postgresql/data" alpine sh -lc "test -f /var/lib/postgresql/data/PG_VERSION"; then
|
||||
echo "Production volume guard passed: '$VOLUME_NAME' contains PostgreSQL data."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user