pipeline build v25 - TAG slicing v2
This commit is contained in:
parent
09dc756230
commit
230a6fb825
@ -9,7 +9,7 @@ steps:
|
|||||||
|
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
# ── Inject known-hosts and SSH key from Secret Manager ─────
|
# ── 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
|
||||||
@ -22,16 +22,17 @@ steps:
|
|||||||
|
|
||||||
echo "🔑 SSH prerequisites installed"
|
echo "🔑 SSH prerequisites installed"
|
||||||
|
|
||||||
# ── Tag slicing from CI_COMMIT_SHA only ────────────────────
|
# ── Grab full commit SHA and slice tag ──────────────────────────
|
||||||
TAG=$(echo "${CI_COMMIT_SHA}" | head -c 8)
|
echo "📦 CI_COMMIT_SHA: ${CI_COMMIT_SHA:-unset}"
|
||||||
|
TAG="${CI_COMMIT_SHA:-}"
|
||||||
if [ -z "$TAG" ]; then
|
if [ -z "$TAG" ]; then
|
||||||
echo "❌ CI_COMMIT_SHA is missing or blank"
|
echo "❌ CI_COMMIT_SHA is blank. Aborting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
TAG=$(echo "$TAG" | head -c 8)
|
||||||
echo "🚀 Deploying tag ${TAG} to staging"
|
echo "🚀 Deploying tag ${TAG} to staging"
|
||||||
|
|
||||||
# ── SSH into staging and refresh the Docker stack ──────────
|
# ── SSH into staging and refresh the stack ──────────────────────
|
||||||
ssh -o StrictHostKeyChecking=yes \
|
ssh -o StrictHostKeyChecking=yes \
|
||||||
-i ~/.ssh/id_ed25519 \
|
-i ~/.ssh/id_ed25519 \
|
||||||
jcoakley@10.128.0.12 \
|
jcoakley@10.128.0.12 \
|
||||||
|
Loading…
Reference in New Issue
Block a user