Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .gitlab/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,20 @@ notify_datadog_release:
before_script:
- apt-get update && apt-get install --no-install-recommends -y curl jq
- >-
DD_STS_API_KEY=$(curl -sS
-H "Authorization: Bearer ${DD_STS_OIDC_TOKEN}"
"https://dd-sts.us1.ddbuild.io/sts/datadog/exchange?policy=dd-trace-py-gitlab")
- >-
DD_STS_APP_KEY=$(curl -sS
DD_STS_RESPONSE=$(curl -sS
-H "Authorization: Bearer ${DD_STS_OIDC_TOKEN}"
"https://dd-sts.us1.ddbuild.io/sts/datadog/exchange?policy=dd-trace-py-gitlab-app-key")
- export DD_API_KEY=$(echo "$DD_STS_API_KEY" | jq -re '.api_key')
- export DD_APP_KEY=$(echo "$DD_STS_APP_KEY" | jq -re '.application_key')
- export DD_API_KEY=$(echo "$DD_STS_RESPONSE" | jq -re '.api_key')
- export DD_APP_KEY=$(echo "$DD_STS_RESPONSE" | jq -re '.application_key')
script:
- sleep 3
Comment thread
gyuheon0h marked this conversation as resolved.
- |
echo "Tag: ${CI_COMMIT_TAG} -> Commit SHA: ${CI_COMMIT_SHA}"
PAYLOAD="{\"version\": \"${CI_COMMIT_TAG}\", \"git_commit_sha\": \"${CI_COMMIT_SHA}\"}"
BODY=$(jq -n --arg input "$PAYLOAD" '{"meta": {"payload": {"input": $input}}}')
curl --retry 3 --retry-delay 2 --fail -X POST \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d "{\"meta\": {\"payload\": {\"version\": \"${CI_COMMIT_TAG}\", \"git_commit_sha\": \"${CI_COMMIT_SHA}\"}}}" \
-d "$BODY" \
https://api.datadoghq.com/api/v2/workflows/dd0d5405-b38c-4f4f-8f4c-c0cd4a65d4d6/instances
Loading