Skip to content

Commit 3141a0e

Browse files
RUM-10224: Introduce check release pipeline
1 parent 2632f5f commit 3141a0e

10 files changed

+1116
-1033
lines changed

.gitlab-ci.yml

Lines changed: 9 additions & 1033 deletions
Large diffs are not rendered by default.
File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
include:
2+
- "ci/pipelines/common-snippets.yml"
3+
- 'https://gitlab-templates.ddbuild.io/slack-notifier/v1/template.yml'
4+
5+
stages:
6+
- check-release
7+
- notify
8+
9+
check-release:is-published:
10+
tags: [ "arch:amd64" ]
11+
image: $CI_IMAGE_DOCKER
12+
stage: check-release
13+
script:
14+
- !reference [ .common-snippets, set-github-installation-token ]
15+
- bash ./ci/scripts/check_latest_release_is_published.sh
16+
17+
notify:report-failure-to-slack:
18+
extends: .slack-notifier-base
19+
stage: notify
20+
when: on_failure
21+
script:
22+
- BUILD_URL="$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID"
23+
- 'MESSAGE_TEXT=":status_alert: Some release artifacts were not published to maven. $BUILD_URL"'
24+
- postmessage "#mobile-sdk-ops" "$MESSAGE_TEXT"

ci/pipelines/common-snippets.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.common-snippets:
2+
set-github-installation-token:
3+
- export GITHUB_APP_CLIENT_ID=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.gh_app_client_id --with-decryption --query "Parameter.Value" --out text)
4+
- export GITHUB_APP_INSTALLATION_ID=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.gh_app_installation_id --with-decryption --query "Parameter.Value" --out text)
5+
- export GITHUB_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.gh_app_private_key --with-decryption --query "Parameter.Value" --out text | bash ./ci/scripts/create_github_installation_token.sh "$GITHUB_APP_CLIENT_ID" "$GITHUB_APP_INSTALLATION_ID")

ci/pipelines/default-pipeline.yml

Lines changed: 1030 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
4+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
5+
# Copyright 2016-Present Datadog, Inc.
6+
#
7+
8+
set -o pipefail
9+
10+
tag_name=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
11+
-H "Accept: application/vnd.github+json" \
12+
https://api.github.com/repos/DataDog/dd-sdk-android/releases/latest | jq -r .tag_name)
13+
14+
repos_list=(
15+
"dd-sdk-android-core"
16+
"dd-sdk-android-internal"
17+
"dd-sdk-android-rum"
18+
"dd-sdk-android-logs"
19+
"dd-sdk-android-trace"
20+
"dd-sdk-android-trace-otel"
21+
"dd-sdk-android-webview"
22+
"dd-sdk-android-session-replay"
23+
"dd-sdk-android-session-replay-compose"
24+
"dd-sdk-android-session-replay-material"
25+
"dd-sdk-android-ndk"
26+
"dd-sdk-android-coil"
27+
"dd-sdk-android-compose"
28+
"dd-sdk-android-glide"
29+
"dd-sdk-android-okhttp"
30+
"dd-sdk-android-okhttp-otel"
31+
"dd-sdk-android-rum-coroutines"
32+
"dd-sdk-android-rx"
33+
"dd-sdk-android-sqldelight"
34+
"dd-sdk-android-timber"
35+
"dd-sdk-android-trace-coroutines"
36+
"dd-sdk-android-tv"
37+
)
38+
39+
for repo in "${repos_list[@]}"; do
40+
status_code=$(curl -s -o /dev/null -w "%{http_code}" "https://repo1.maven.org/maven2/com/datadoghq/$repo/$tag_name/$repo-$tag_name.aar")
41+
42+
if [ $status_code -eq 200 ]; then
43+
echo "Release $tag_name exists for $repo"
44+
else
45+
echo "Release $tag_name doesn't exist for $repo"
46+
exit 1
47+
fi
48+
done
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)