fix(cloudbuild): fix webhook notify step line break + correct smoke-test URL
This commit is contained in:
parent
1f126544f4
commit
2b1bd24e73
|
|
@ -67,23 +67,16 @@ steps:
|
|||
- '-c'
|
||||
- |
|
||||
echo "=== Smoke Test ==="
|
||||
BASE_URL="https://osvauco-agent-357036551735.us-central1.run.app"
|
||||
BASE_URL="https://osvauco-agent-zjbqp3prqq-uc.a.run.app"
|
||||
echo "BASE_URL: $$BASE_URL"
|
||||
|
||||
|
||||
TOKEN=$$(curl -s -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=$$BASE_URL&format=full")
|
||||
echo "TOKEN_EMPTY: $([ -z "$$TOKEN" ] && echo YES || echo NO)"
|
||||
echo "TOKEN_PREFIX: $${TOKEN:0:30}"
|
||||
|
||||
echo "=== Raw curl output ==="
|
||||
curl -v -H "Authorization: Bearer $$TOKEN" \
|
||||
"$$BASE_URL/health" 2>&1
|
||||
|
||||
echo "=== Without auth ==="
|
||||
curl -v "$$BASE_URL/health" 2>&1
|
||||
|
||||
echo "=== Debug done ==="
|
||||
|
||||
# Steg 6: Deploy-notifikasjon til webhook/chat-app
|
||||
curl -s -H "Authorization: Bearer $$TOKEN" "$$BASE_URL/health" && echo "OK" || echo "WARN: health check feilet"
|
||||
echo "=== Smoke Test ferdig ==="
|
||||
|
||||
# Steg 6: Deploy-notifikasjon til Google Chat
|
||||
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
|
||||
id: notify
|
||||
waitFor: ['smoke-test']
|
||||
|
|
@ -91,15 +84,15 @@ steps:
|
|||
args:
|
||||
- '-c'
|
||||
- |
|
||||
WH_URL=$$(gcloud secrets versions access latest
|
||||
--secret=webhook-url
|
||||
WH_URL=$$(gcloud secrets versions access latest \
|
||||
--secret=webhook-url \
|
||||
--project=${PROJECT_ID} 2>/dev/null || echo "")
|
||||
if [[ -n "$$WH_URL" ]]; then
|
||||
NOTIFY_MSG="✅ OSVauco Deploy fullført. Commit: $COMMIT_SHA, Service: ${_CLOUD_RUN_SERVICE}, Region: ${_REGION}"
|
||||
MSG="✅ OSVauco deploy fullført\nCommit: $COMMIT_SHA\nService: ${_CLOUD_RUN_SERVICE} (${_REGION})\nhttps://opax.vauco.no"
|
||||
curl -s -X POST "$$WH_URL" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{\"text\": \"$$NOTIFY_MSG\"}" || true
|
||||
echo "✓ Deploy-notifikasjon sendt"
|
||||
-d "{\"text\": \"$$MSG\"}" || true
|
||||
echo "✓ Google Chat-varsling sendt"
|
||||
else
|
||||
echo "⚠️ Ingen webhook-url i Secret Manager — hopper over varsling"
|
||||
fi
|
||||
|
|
@ -108,7 +101,7 @@ substitutions:
|
|||
_REGION: us-central1
|
||||
_ARTIFACT_REPO: osvauco-repo
|
||||
_CLOUD_RUN_SERVICE: osvauco-agent
|
||||
_CLOUD_RUN_URL: osvauco-agent-357036551735.us-central1.run.app
|
||||
_CLOUD_RUN_URL: osvauco-agent-zjbqp3prqq-uc.a.run.app
|
||||
_AGENT_SA: osvauco-agent-sa@propane-will-491900-m5.iam.gserviceaccount.com
|
||||
_GEMINI_LOCATION: global
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user