From ca4bad2ba761ae8f5058b75e6b6f32ba328617c6 Mon Sep 17 00:00:00 2001 From: DevOps Date: Sun, 21 Jun 2026 21:32:25 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20repair=20deploy=20pipeline=20=E2=80=94?= =?UTF-8?q?=20boolean=20type=20and=20unterminated=20quoted=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .gitea/workflows/deploy.yaml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index ee3a19a..09a9b41 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -41,10 +41,10 @@ on: default: '' type: string no_cache: - description: 'Disable Docker build cache' + description: 'Disable Docker build cache (true/false)' required: false - default: false - type: boolean + default: 'false' + type: string git_ref: description: 'Git ref to deploy (branch, tag, or commit SHA; default: main)' required: false @@ -212,14 +212,15 @@ jobs: set -euo pipefail # Auto-deploy: always use cache. Manual: respect no_cache input. - NO_CACHE="${{ github.event_name == 'workflow_dispatch' && inputs.no_cache || false }}" BUILD_ARGS="" - if [ "$NO_CACHE" = "true" ]; then - BUILD_ARGS="--no-cache" + SERVICE_ARG="" + 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 - SERVICE_ARG="${{ github.event_name == 'workflow_dispatch' && inputs.service || '' }}" - # Write the deploy script to a file to avoid nested quoting issues cat > /tmp/nexus-deploy-script.sh << 'DEPLOYSCRIPT' #!/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) if [ -n "$PG_VOL" ]; then echo "Checking postgres WAL integrity..." - docker run --rm -v "$PG_VOL:/var/lib/postgresql/data" \ - --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)' + 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)" else - echo 'Postgres volume not found - will be created fresh' + echo "Postgres volume not found - will be created fresh" fi BUILD_ARGS="${DEPLOY_BUILD_ARGS:-}"