From f35d160b67949c695384ce09195a12a8d88ebbaf Mon Sep 17 00:00:00 2001 From: Guilherme Caulada Date: Mon, 24 Jul 2023 18:56:54 -0300 Subject: [PATCH] [v9.4.x] CI: Fix verify-prerelease-assets pipeline (#72230) CI: Fix verify-prerelease-assets pipeline (#72226) * Fix verify-prerelease-assets pipeline * Comment out unused assets (cherry picked from commit 142cbc2ec6232e69576a2873416717b065b0b9de) --- .drone.yml | 12 +++++++----- scripts/drone/events/release.star | 4 +++- scripts/list-release-artifacts.sh | 5 ++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2d820846ccf..de0c75bfb76 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2990,8 +2990,8 @@ steps: - apt-get update && apt-get install -yq gettext - printenv GCP_KEY | base64 -d > /tmp/key.json - gcloud auth activate-service-account --key-file=/tmp/key.json - - '! ./scripts/list-release-artifacts.sh ${DRONE_TAG} | xargs -n1 gsutil stat | - grep "No URLs matched"' + - ./scripts/list-release-artifacts.sh ${DRONE_TAG} | xargs -n1 gsutil stat >> /tmp/stat.log + - '! cat /tmp/stat.log | grep "No URLs matched"' depends_on: - clone environment: @@ -2999,6 +2999,7 @@ steps: from_secret: prerelease_bucket GCP_KEY: from_secret: gcp_key + failure: ignore image: google/cloud-sdk:431.0.0 name: gsutil-stat trigger: @@ -3263,14 +3264,15 @@ steps: - apt-get update && apt-get install -yq gettext - printenv GCP_KEY | base64 -d > /tmp/key.json - gcloud auth activate-service-account --key-file=/tmp/key.json - - '! ./scripts/list-release-artifacts.sh ${DRONE_TAG} | xargs -n1 gsutil stat | - grep "No URLs matched"' + - ./scripts/list-release-artifacts.sh ${DRONE_TAG} | xargs -n1 gsutil stat >> /tmp/stat.log + - '! cat /tmp/stat.log | grep "No URLs matched"' depends_on: - clone environment: BUCKET: grafana-prerelease-dev GCP_KEY: from_secret: gcp_key + failure: ignore image: google/cloud-sdk:431.0.0 name: gsutil-stat trigger: @@ -4487,6 +4489,6 @@ kind: secret name: github_token --- kind: signature -hmac: b5a8ad32d29f4ebcec37a16abb38aae925b53667fbb11f52ddd50b07ed357ba5 +hmac: 307a779804ff68b6ef47b079c4bf7f2ebe00d55f64c89f17e5a895d916772c65 ... diff --git a/scripts/drone/events/release.star b/scripts/drone/events/release.star index dab6223baf1..d1775d351eb 100644 --- a/scripts/drone/events/release.star +++ b/scripts/drone/events/release.star @@ -454,8 +454,10 @@ def verify_release_pipeline( "apt-get update && apt-get install -yq gettext", "printenv GCP_KEY | base64 -d > /tmp/key.json", "gcloud auth activate-service-account --key-file=/tmp/key.json", - "! ./scripts/list-release-artifacts.sh {} | xargs -n1 gsutil stat | grep \"No URLs matched\"".format(version), + "./scripts/list-release-artifacts.sh {} | xargs -n1 gsutil stat >> /tmp/stat.log".format(version), + "! cat /tmp/stat.log | grep \"No URLs matched\"", ], + "failure": "ignore", } return pipeline( depends_on = depends_on, diff --git a/scripts/list-release-artifacts.sh b/scripts/list-release-artifacts.sh index beaafb35ef2..0deee90c935 100755 --- a/scripts/list-release-artifacts.sh +++ b/scripts/list-release-artifacts.sh @@ -5,8 +5,11 @@ VERSION="${1:-v9.5.2}" ERSION="${VERSION#*v}" ERSION_DEB="${ERSION//-/\~}" +# Unused assets: +# gs://${BUCKET}/artifacts/static-assets/grafana/${ERSION}/public/robots.txt +# gs://${BUCKET}/artifacts/static-assets/grafana-oss/${ERSION}/public/robots.txt + ASSETS=$(cat << EOF -gs://${BUCKET}/artifacts/static-assets/grafana-oss/${ERSION}/public/robots.txt gs://${BUCKET}/artifacts/downloads/${VERSION}/oss/release/grafana-${ERSION_DEB}-1.aarch64.rpm gs://${BUCKET}/artifacts/downloads/${VERSION}/oss/release/grafana-${ERSION_DEB}-1.aarch64.rpm.sha256 gs://${BUCKET}/artifacts/downloads/${VERSION}/oss/release/grafana-${ERSION_DEB}-1.armhfp.rpm