From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- taskcluster/docker/sentry/Dockerfile | 11 ++++++++ taskcluster/docker/sentry/prepare.sh | 18 ++++++++++++++ taskcluster/docker/sentry/submit_sentry_release.sh | 29 ++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 taskcluster/docker/sentry/Dockerfile create mode 100755 taskcluster/docker/sentry/prepare.sh create mode 100644 taskcluster/docker/sentry/submit_sentry_release.sh (limited to 'taskcluster/docker/sentry') diff --git a/taskcluster/docker/sentry/Dockerfile b/taskcluster/docker/sentry/Dockerfile new file mode 100644 index 0000000000..2f606c5529 --- /dev/null +++ b/taskcluster/docker/sentry/Dockerfile @@ -0,0 +1,11 @@ +FROM $DOCKER_IMAGE_PARENT +LABEL maintainer="Mitchell Hentges mhentges@mozilla.com" + +VOLUME /builds/worker/checkouts + +ADD prepare.sh /setup/prepare-docker.sh +ADD submit_sentry_release.sh /usr/bin/submit_sentry_release.sh +RUN /bin/bash /setup/prepare-docker.sh && rm -R /setup + +# Set a default command useful for debugging +CMD ["/bin/sh", "--login"] diff --git a/taskcluster/docker/sentry/prepare.sh b/taskcluster/docker/sentry/prepare.sh new file mode 100755 index 0000000000..7cce3e1955 --- /dev/null +++ b/taskcluster/docker/sentry/prepare.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -o errexit +set -o nounset +set -o xtrace + +apt-get -y update + +# Install: +# * curl to fetch sentry-cli +# * jq to parse hgmo pushlog +apt-get install -y \ + curl \ + jq + +# Install sentry-cli to publish releases +curl -L https://github.com/getsentry/sentry-cli/releases/download/1.63.1/sentry-cli-Linux-x86_64 -o /usr/bin/sentry-cli +chmod +x /usr/bin/sentry-cli diff --git a/taskcluster/docker/sentry/submit_sentry_release.sh b/taskcluster/docker/sentry/submit_sentry_release.sh new file mode 100644 index 0000000000..136e06a58a --- /dev/null +++ b/taskcluster/docker/sentry/submit_sentry_release.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -o nounset +set -o pipefail + +run() { + revisions=$(curl "$HG_PUSHLOG_URL" | jq -c -r ".pushes[].changesets | @sh" | tr -d \') || return 1 + sentry_api_key=$(curl "http://taskcluster/secrets/v1/secret/$SENTRY_SECRET" | jq -r ".secret.sentryToken") || return 1 + for revision in $revisions; do + SENTRY_AUTH_TOKEN=$sentry_api_key SENTRY_ORG=mozilla sentry-cli --url https://sentry.io/ releases --project mach new "hg-rev-$revision" || return 1 + done +} + +with_backoff() { + failures=0 + while ! "$@"; do + failures=$(( failures + 1 )) + if (( failures >= 5 )); then + echo "[with_backoff] Unable to succeed after 5 tries, failing the job." + return 1 + else + seconds=$(( 2 ** (failures - 1) )) + echo "[with_backoff] Retrying in $seconds second(s)" + sleep $seconds + fi + done +} + +with_backoff run -- cgit v1.2.3