fix: repair deploy pipeline — boolean type and unterminated quoted string
- Changed no_cache input type from boolean to string (Gitea 1.26.3 compat) - Fixed multi-line double-quoted string in DEPLOYSCRIPT heredoc - Hardened inputs.* references with proper short-circuit fallbacks
This commit is contained in:
@@ -41,10 +41,10 @@ on:
|
|||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
no_cache:
|
no_cache:
|
||||||
description: 'Disable Docker build cache'
|
description: 'Disable Docker build cache (true/false)'
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: 'false'
|
||||||
type: boolean
|
type: string
|
||||||
git_ref:
|
git_ref:
|
||||||
description: 'Git ref to deploy (branch, tag, or commit SHA; default: main)'
|
description: 'Git ref to deploy (branch, tag, or commit SHA; default: main)'
|
||||||
required: false
|
required: false
|
||||||
@@ -212,14 +212,15 @@ jobs:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Auto-deploy: always use cache. Manual: respect no_cache input.
|
# Auto-deploy: always use cache. Manual: respect no_cache input.
|
||||||
NO_CACHE="${{ github.event_name == 'workflow_dispatch' && inputs.no_cache || false }}"
|
|
||||||
BUILD_ARGS=""
|
BUILD_ARGS=""
|
||||||
if [ "$NO_CACHE" = "true" ]; then
|
SERVICE_ARG=""
|
||||||
BUILD_ARGS="--no-cache"
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
if [ "${{ github.event_name == 'workflow_dispatch' && inputs.no_cache || 'false' }}" = "true" ]; then
|
||||||
|
BUILD_ARGS="--no-cache"
|
||||||
|
fi
|
||||||
|
SERVICE_ARG="${{ github.event_name == 'workflow_dispatch' && inputs.service || '' }}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SERVICE_ARG="${{ github.event_name == 'workflow_dispatch' && inputs.service || '' }}"
|
|
||||||
|
|
||||||
# Write the deploy script to a file to avoid nested quoting issues
|
# Write the deploy script to a file to avoid nested quoting issues
|
||||||
cat > /tmp/nexus-deploy-script.sh << 'DEPLOYSCRIPT'
|
cat > /tmp/nexus-deploy-script.sh << 'DEPLOYSCRIPT'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
@@ -235,13 +236,9 @@ docker rm -f nexus-postgres-1 nexus-api-1 nexus-web-1 2>/dev/null || true
|
|||||||
PG_VOL=$(docker volume ls -q --filter name=nexus-postgres 2>/dev/null | head -1)
|
PG_VOL=$(docker volume ls -q --filter name=nexus-postgres 2>/dev/null | head -1)
|
||||||
if [ -n "$PG_VOL" ]; then
|
if [ -n "$PG_VOL" ]; then
|
||||||
echo "Checking postgres WAL integrity..."
|
echo "Checking postgres WAL integrity..."
|
||||||
docker run --rm -v "$PG_VOL:/var/lib/postgresql/data" \
|
docker run --rm -v "$PG_VOL:/var/lib/postgresql/data" --entrypoint sh postgres:17-alpine -c "pg_resetwal -f /var/lib/postgresql/data && echo 'WAL reset OK'" 2>&1 || echo "pg_resetwal failed (may be benign)"
|
||||||
--entrypoint sh postgres:17-alpine -c "
|
|
||||||
echo 'Resetting WAL...'
|
|
||||||
pg_resetwal -f /var/lib/postgresql/data && echo 'WAL reset OK'
|
|
||||||
" 2>&1 || echo 'pg_resetwal failed (may be benign)'
|
|
||||||
else
|
else
|
||||||
echo 'Postgres volume not found - will be created fresh'
|
echo "Postgres volume not found - will be created fresh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_ARGS="${DEPLOY_BUILD_ARGS:-}"
|
BUILD_ARGS="${DEPLOY_BUILD_ARGS:-}"
|
||||||
|
|||||||
Reference in New Issue
Block a user