pipeline build v46. Reverted to working

This commit is contained in:
Josh 2025-07-31 17:16:42 +00:00
parent e259c529af
commit c9275f3b03

View File

@ -1,31 +1,26 @@
---
kind: pipeline
type: docker
name: ssh-test
steps: steps:
- name: ssh-test - name: ssh-test
image: google/cloud-sdk:latest image: google/cloud-sdk:latest
entrypoint: entrypoint:
- bash - bash
- -c - -c
- > - |
set -euo pipefail; set -euo pipefail
mkdir -p ~/.ssh; mkdir -p ~/.ssh
# ── Inject known-hosts and SSH key ─────────────────────────────── # ── Inject known-hosts and SSH key ───────────────────────────────
gcloud secrets versions access latest \ gcloud secrets versions access latest \
--secret=STAGING_KNOWN_HOSTS --project=aptivaai-dev \ --secret=STAGING_KNOWN_HOSTS --project=aptivaai-dev \
| base64 -d > ~/.ssh/known_hosts; | base64 -d > ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts; chmod 644 ~/.ssh/known_hosts
gcloud secrets versions access latest \ gcloud secrets versions access latest \
--secret=STAGING_SSH_KEY --project=aptivaai-dev \ --secret=STAGING_SSH_KEY --project=aptivaai-dev \
| base64 -d > ~/.ssh/id_ed25519; | base64 -d > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519; chmod 600 ~/.ssh/id_ed25519
echo "🔑 SSH prerequisites installed"; echo "🔑 SSH prerequisites installed"
# ── SSH into staging and deploy ────────────────────────────────── # ── SSH into staging and deploy ──────────────────────────────────
ssh -o StrictHostKeyChecking=yes \ ssh -o StrictHostKeyChecking=yes \
@ -40,11 +35,11 @@ steps:
sudo --preserve-env=IMG_TAG docker compose pull; \ sudo --preserve-env=IMG_TAG docker compose pull; \
sudo --preserve-env=IMG_TAG docker compose up -d --force-recreate --remove-orphans; \ sudo --preserve-env=IMG_TAG docker compose up -d --force-recreate --remove-orphans; \
echo "✅ Staging stack refreshed with tag $IMG_TAG"' echo "✅ Staging stack refreshed with tag $IMG_TAG"'
secrets: secrets:
- STAGING_SSH_KEY - STAGING_SSH_KEY
- STAGING_KNOWN_HOSTS - STAGING_KNOWN_HOSTS
- IMG_TAG
when: when:
event: event:
- push - push