1+ curl -OL " binaries.ddbuild.io/dd-source/authanywhere/LATEST/authanywhere-linux-amd64" && mv " authanywhere-linux-amd64" /bin/authanywhere && chmod +x /bin/authanywhere
2+
3+ BTI_CI_API_TOKEN=$( authanywhere --audience rapid-devex-ci)
4+
5+ BTI_RESPONSE=$( curl --silent --request GET \
6+ --header " $BTI_CI_API_TOKEN " \
7+ --header " Content-Type: application/vnd.api+json" \
8+ " https://bti-ci-api.us1.ddbuild.io/internal/ci/gitlab/token?owner=DataDog&repository=datadog-lambda-python" )
9+
10+ GITLAB_TOKEN=$( echo " $BTI_RESPONSE " | jq -r ' .token // empty' )
11+
12+ URL=" ${CI_API_V4_URL} /projects/${CI_PROJECT_ID} /pipelines/${CI_PIPELINE_ID} /bridges"
13+
14+ echo " Fetching E2E job status from: $URL "
15+
16+ while true ; do
17+ RESPONSE=$( curl -s --header " PRIVATE-TOKEN: ${GITLAB_TOKEN} " " $URL " )
18+ E2E_JOB_STATUS=$( echo " $RESPONSE " | jq -r ' .[] | select(.name=="e2e-test") | .downstream_pipeline.status' )
19+ echo -n " E2E job status: $E2E_JOB_STATUS , "
20+ if [ " $E2E_JOB_STATUS " == " success" ]; then
21+ echo " ✅ E2E tests completed successfully"
22+ exit 0
23+ elif [ " $E2E_JOB_STATUS " == " failed" ]; then
24+ echo " ❌ E2E tests failed"
25+ exit 1
26+ elif [ " $E2E_JOB_STATUS " == " running" ]; then
27+ echo " ⏳ E2E tests are still running, retrying in 2 minutes..."
28+ elif [ " $E2E_JOB_STATUS " == " canceled" ]; then
29+ echo " 🚫 E2E tests were canceled"
30+ exit 1
31+ elif [ " $E2E_JOB_STATUS " == " skipped" ]; then
32+ echo " ⏭️ E2E tests were skipped"
33+ exit 0
34+ else
35+ echo " ❓ Unknown E2E test status: $E2E_JOB_STATUS , retrying in 2 minutes..."
36+ fi
37+ sleep 120
38+ done
0 commit comments