From 0c3238a611ee96348116280ee8c54b3d959606a7 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 31 Jul 2025 15:01:22 +0000 Subject: [PATCH] pipeline build v19 - Copilot bash fix --- .woodpecker.yml | 57 ++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index a2430fb..900dbdb 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,39 +1,34 @@ steps: - ssh-test: # keep the name, keep the image + ssh-test: image: google/cloud-sdk:latest - commands: - - | - #!/usr/bin/env bash - set -euo pipefail + entrypoint: ["bash", "-c"] + commands: | + set -euo pipefail - mkdir -p ~/.ssh + mkdir -p ~/.ssh - # ── Install known‑hosts from Secret Manager ───────────────── - gcloud secrets versions access latest \ - --secret=STAGING_KNOWN_HOSTS --project=aptivaai-dev \ - | base64 -d > ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts + gcloud secrets versions access latest \ + --secret=STAGING_KNOWN_HOSTS --project=aptivaai-dev \ + | base64 -d > ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts - # ── Install private key ──────────────────────────────────── - gcloud secrets versions access latest \ - --secret=STAGING_SSH_KEY --project=aptivaai-dev \ - | base64 -d > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 + gcloud secrets versions access latest \ + --secret=STAGING_SSH_KEY --project=aptivaai-dev \ + | base64 -d > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 - echo "🔑 SSH prerequisites installed" + echo "🔑 SSH prerequisites installed" - # ── Tag = first 8 chars of the commit SHA that triggered CI ─ - TAG=$(echo "${CI_COMMIT_SHA:-$DRONE_COMMIT_SHA}" | head -c 8) - echo "🚀 Deploying tag ${TAG} to staging" + TAG=$(echo "${CI_COMMIT_SHA:-$DRONE_COMMIT_SHA}" | head -c 8) + echo "🚀 Deploying tag ${TAG} to staging" - # ── SSH into the staging VM and refresh the stack ────────── - ssh -o StrictHostKeyChecking=yes \ - -i ~/.ssh/id_ed25519 \ - jcoakley@10.128.0.12 \ - "set -euo pipefail; \ - cd /opt/aptiva-staging-app; \ - echo 'Pulling containers'; \ - IMG_TAG=${TAG} docker compose pull; \ - echo 'Re‑creating services'; \ - IMG_TAG=${TAG} docker compose up -d --force-recreate --remove-orphans; \ - echo '✅ Staging stack refreshed with tag ${TAG}'" + ssh -o StrictHostKeyChecking=yes \ + -i ~/.ssh/id_ed25519 \ + jcoakley@10.128.0.12 \ + "set -euo pipefail; \ + cd /opt/aptiva-staging-app; \ + echo 'Pulling containers'; \ + IMG_TAG=${TAG} docker compose pull; \ + echo 'Re‑creating services'; \ + IMG_TAG=${TAG} docker compose up -d --force-recreate --remove-orphans; \ + echo '✅ Staging stack refreshed with tag ${TAG}'"