From 5d5519b435ea73c6e6691d077d7ca9f20b4232ae Mon Sep 17 00:00:00 2001 From: Guilherme Caulada Date: Tue, 25 Jul 2023 13:32:33 -0300 Subject: [PATCH] Make RGM the main pipeline for prerelease --- .drone.star | 4 - .drone.yml | 748 +++++++++------------------------------ scripts/drone/rgm.star | 75 ++-- scripts/drone/vault.star | 6 + 4 files changed, 221 insertions(+), 612 deletions(-) diff --git a/.drone.star b/.drone.star index 39cb4b7fe5d..ce31860e844 100644 --- a/.drone.star +++ b/.drone.star @@ -12,11 +12,9 @@ load("scripts/drone/events/main.star", "main_pipelines") load( "scripts/drone/events/release.star", "integration_test_pipelines", - "oss_pipelines", "publish_artifacts_pipelines", "publish_npm_pipelines", "publish_packages_pipeline", - "verify_release_pipeline", ) load( "scripts/drone/rgm.star", @@ -43,12 +41,10 @@ def main(_ctx): return ( pr_pipelines() + main_pipelines() + - oss_pipelines() + publish_image_pipelines_public() + publish_artifacts_pipelines("public") + publish_npm_pipelines() + publish_packages_pipeline() + - [verify_release_pipeline()] + rgm() + [windows_test_backend({ "event": ["promote"], diff --git a/.drone.yml b/.drone.yml index 78f3325937b..a65306a867e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2470,558 +2470,6 @@ environment: image_pull_secrets: - dockerconfigjson kind: pipeline -name: release-whatsnew-checker -node: - type: no-parallel -platform: - arch: amd64 - os: linux -services: [] -steps: -- commands: - - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd - depends_on: [] - environment: - CGO_ENABLED: 0 - image: golang:1.20.6 - name: compile-build-cmd -- commands: - - ./bin/build whatsnew-checker - depends_on: - - compile-build-cmd - image: golang:1.20.6 - name: whats-new-checker -trigger: - event: - exclude: - - promote - ref: - exclude: - - refs/tags/*-cloud* - include: - - refs/tags/v* -type: docker -volumes: -- host: - path: /var/run/docker.sock - name: docker ---- -clone: - retries: 3 -depends_on: [] -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: release-build-e2e-publish -node: - type: no-parallel -platform: - arch: amd64 - os: linux -services: [] -steps: -- commands: - - echo $DRONE_RUNNER_NAME - image: alpine:3.17.1 - name: identify-runner -- commands: - - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - - chmod +x bin/grabpl - image: byrnedo/alpine-curl:0.1.8 - name: grabpl -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - depends_on: [] - image: grafana/build-container:1.7.5 - name: verify-gen-cue -- commands: - - make gen-go - depends_on: - - verify-gen-cue - image: grafana/build-container:1.7.5 - name: wire-install -- commands: - - yarn install --immutable - depends_on: [] - image: grafana/build-container:1.7.5 - name: yarn-install -- commands: - - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd - depends_on: [] - environment: - CGO_ENABLED: 0 - image: golang:1.20.6 - name: compile-build-cmd -- commands: - - ./bin/build build-backend --jobs 8 --edition oss ${DRONE_TAG} - depends_on: - - wire-install - - compile-build-cmd - image: grafana/build-container:1.7.5 - name: build-backend -- commands: - - ./bin/build build-frontend --jobs 8 --edition oss ${DRONE_TAG} - depends_on: - - compile-build-cmd - - yarn-install - environment: - NODE_OPTIONS: --max_old_space_size=8192 - image: grafana/build-container:1.7.5 - name: build-frontend -- commands: - - ./bin/build build-frontend-packages --jobs 8 --edition oss ${DRONE_TAG} - depends_on: - - compile-build-cmd - - yarn-install - environment: - NODE_OPTIONS: --max_old_space_size=8192 - image: grafana/build-container:1.7.5 - name: build-frontend-packages -- commands: - - ./bin/build build-plugins --jobs 8 --edition oss - depends_on: - - compile-build-cmd - - yarn-install - environment: - GRAFANA_API_KEY: - from_secret: grafana_api_key - image: grafana/build-container:1.7.5 - name: build-plugins -- commands: - - ./bin/build package --jobs 8 --edition oss --sign $${DRONE_TAG} - depends_on: - - build-plugins - - build-backend - - build-frontend - - build-frontend-packages - environment: - GPG_KEY_PASSWORD: - from_secret: packages_gpg_passphrase - GPG_PRIV_KEY: - from_secret: packages_gpg_private_key - GPG_PUB_KEY: - from_secret: packages_gpg_public_key - GRAFANA_API_KEY: - from_secret: grafana_api_key - image: grafana/build-container:1.7.5 - name: package -- commands: - - ls dist/*.tar.gz* - - cp dist/*.tar.gz* packaging/docker/ - depends_on: - - package - image: grafana/build-container:1.7.5 - name: copy-packages-for-docker -- commands: - - ./bin/build build-docker --edition oss --shouldSave - depends_on: - - copy-packages-for-docker - - compile-build-cmd - environment: - GCP_KEY: - from_secret: gcp_grafanauploads - image: google/cloud-sdk:431.0.0 - name: build-docker-images - volumes: - - name: docker - path: /var/run/docker.sock -- commands: - - ./bin/build build-docker --edition oss --shouldSave --ubuntu - depends_on: - - copy-packages-for-docker - - compile-build-cmd - environment: - GCP_KEY: - from_secret: gcp_grafanauploads - image: google/cloud-sdk:431.0.0 - name: build-docker-images-ubuntu - volumes: - - name: docker - path: /var/run/docker.sock -- commands: - - ./scripts/grafana-server/start-server - depends_on: - - build-plugins - - build-backend - - build-frontend - - build-frontend-packages - detach: true - environment: - ARCH: linux-amd64 - PORT: 3001 - image: grafana/build-container:1.7.5 - name: grafana-server -- commands: - - apt-get install -y netcat - - ./bin/build e2e-tests --port 3001 --suite dashboards-suite --tries 3 - depends_on: - - grafana-server - environment: - HOST: grafana-server - image: cypress/included:9.5.1-node16.14.0-slim-chrome99-ff97 - name: end-to-end-tests-dashboards-suite -- commands: - - apt-get install -y netcat - - ./bin/build e2e-tests --port 3001 --suite smoke-tests-suite --tries 3 - depends_on: - - grafana-server - environment: - HOST: grafana-server - image: cypress/included:9.5.1-node16.14.0-slim-chrome99-ff97 - name: end-to-end-tests-smoke-tests-suite -- commands: - - apt-get install -y netcat - - ./bin/build e2e-tests --port 3001 --suite panels-suite --tries 3 - depends_on: - - grafana-server - environment: - HOST: grafana-server - image: cypress/included:9.5.1-node16.14.0-slim-chrome99-ff97 - name: end-to-end-tests-panels-suite -- commands: - - apt-get install -y netcat - - ./bin/build e2e-tests --port 3001 --suite various-suite --tries 3 - depends_on: - - grafana-server - environment: - HOST: grafana-server - image: cypress/included:9.5.1-node16.14.0-slim-chrome99-ff97 - name: end-to-end-tests-various-suite -- commands: - - apt-get update - - apt-get install -yq zip - - printenv GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY > /tmp/gcpkey_upload_artifacts.json - - gcloud auth activate-service-account --key-file=/tmp/gcpkey_upload_artifacts.json - - find ./e2e -type f -name "*spec.ts.mp4" | zip e2e/videos.zip -@ - - gsutil cp e2e/videos.zip gs://$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip - - export E2E_ARTIFACTS_VIDEO_ZIP=https://storage.googleapis.com/$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip - - 'echo "E2E Test artifacts uploaded to: $${E2E_ARTIFACTS_VIDEO_ZIP}"' - - 'curl -X POST https://api.github.com/repos/${DRONE_REPO}/statuses/${DRONE_COMMIT_SHA} - -H "Authorization: token $${GITHUB_TOKEN}" -d "{\"state\":\"success\",\"target_url\":\"$${E2E_ARTIFACTS_VIDEO_ZIP}\", - \"description\": \"Click on the details to download e2e recording videos\", \"context\": - \"e2e_artifacts\"}"' - depends_on: - - end-to-end-tests-dashboards-suite - - end-to-end-tests-panels-suite - - end-to-end-tests-smoke-tests-suite - - end-to-end-tests-various-suite - environment: - E2E_TEST_ARTIFACTS_BUCKET: releng-pipeline-artifacts-dev - GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY: - from_secret: gcp_upload_artifacts_key - GITHUB_TOKEN: - from_secret: github_token - failure: ignore - image: google/cloud-sdk:431.0.0 - name: e2e-tests-artifacts-upload - when: - status: - - success - - failure -- commands: - - yarn storybook:build - - ./bin/build verify-storybook - depends_on: - - build-frontend - - build-frontend-packages - environment: - NODE_OPTIONS: --max_old_space_size=4096 - image: grafana/build-container:1.7.5 - name: build-storybook - when: - event: - - tag -- commands: - - ./bin/build upload-cdn --edition oss - depends_on: - - grafana-server - environment: - GCP_KEY: - from_secret: gcp_grafanauploads - PRERELEASE_BUCKET: - from_secret: prerelease_bucket - image: grafana/grafana-ci-deploy:1.3.3 - name: upload-cdn-assets -- commands: - - ./bin/build upload-packages --edition oss - depends_on: - - end-to-end-tests-dashboards-suite - - end-to-end-tests-panels-suite - - end-to-end-tests-smoke-tests-suite - - end-to-end-tests-various-suite - environment: - GCP_KEY: - from_secret: gcp_grafanauploads_base64 - PRERELEASE_BUCKET: - from_secret: prerelease_bucket - image: grafana/grafana-ci-deploy:1.3.3 - name: upload-packages -- commands: - - ./bin/build store-storybook --deployment latest - - ./bin/build store-storybook --deployment ${DRONE_TAG} - depends_on: - - build-storybook - - end-to-end-tests-dashboards-suite - - end-to-end-tests-panels-suite - - end-to-end-tests-smoke-tests-suite - - end-to-end-tests-various-suite - environment: - GCP_KEY: - from_secret: gcp_grafanauploads - PRERELEASE_BUCKET: - from_secret: prerelease_bucket - image: grafana/grafana-ci-deploy:1.3.3 - name: store-storybook - when: - event: - - tag -- commands: - - ./bin/build artifacts npm store --tag ${DRONE_TAG} - depends_on: - - compile-build-cmd - - build-frontend-packages - environment: - GCP_KEY: - from_secret: gcp_upload_artifacts_key - PRERELEASE_BUCKET: - from_secret: prerelease_bucket - image: grafana/build-container:1.7.5 - name: store-npm-packages -trigger: - event: - exclude: - - promote - ref: - exclude: - - refs/tags/*-cloud* - include: - - refs/tags/v* -type: docker -volumes: -- host: - path: /var/run/docker.sock - name: docker ---- -clone: - retries: 3 -depends_on: [] -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: release-test-frontend -node: - type: no-parallel -platform: - arch: amd64 - os: linux -services: [] -steps: -- commands: - - echo $DRONE_RUNNER_NAME - image: alpine:3.17.1 - name: identify-runner -- commands: - - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - - chmod +x bin/grabpl - image: byrnedo/alpine-curl:0.1.8 - name: grabpl -- commands: - - yarn install --immutable - depends_on: [] - image: grafana/build-container:1.7.5 - name: yarn-install -- commands: - - yarn betterer ci - depends_on: - - yarn-install - image: grafana/build-container:1.7.5 - name: betterer-frontend -- commands: - - yarn run ci:test-frontend - depends_on: - - yarn-install - environment: - TEST_MAX_WORKERS: 50% - image: grafana/build-container:1.7.5 - name: test-frontend -trigger: - event: - exclude: - - promote - ref: - exclude: - - refs/tags/*-cloud* - include: - - refs/tags/v* -type: docker -volumes: -- host: - path: /var/run/docker.sock - name: docker ---- -clone: - retries: 3 -depends_on: [] -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: release-test-backend -node: - type: no-parallel -platform: - arch: amd64 - os: linux -services: [] -steps: -- commands: - - echo $DRONE_RUNNER_NAME - image: alpine:3.17.1 - name: identify-runner -- commands: - - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd - depends_on: [] - environment: - CGO_ENABLED: 0 - image: golang:1.20.6 - name: compile-build-cmd -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - depends_on: [] - image: grafana/build-container:1.7.5 - name: verify-gen-cue -- commands: - - '# It is required that generated jsonnet is committed and in sync with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-jsonnet - depends_on: [] - image: grafana/build-container:1.7.5 - name: verify-gen-jsonnet -- commands: - - make gen-go - depends_on: - - verify-gen-cue - image: grafana/build-container:1.7.5 - name: wire-install -- commands: - - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... - depends_on: - - wire-install - image: grafana/build-container:1.7.5 - name: test-backend -- commands: - - go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find - ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' - | grep -o '\(.*\)/' | sort -u) - depends_on: - - wire-install - image: grafana/build-container:1.7.5 - name: test-backend-integration -trigger: - event: - exclude: - - promote - ref: - exclude: - - refs/tags/*-cloud* - include: - - refs/tags/v* -type: docker -volumes: -- host: - path: /var/run/docker.sock - name: docker ---- -clone: - retries: 3 -depends_on: -- release-build-e2e-publish -- release-test-frontend -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline -name: release-windows -platform: - arch: amd64 - os: windows - version: "1809" -services: [] -steps: -- commands: - - echo $env:DRONE_RUNNER_NAME - image: mcr.microsoft.com/windows:1809 - name: identify-runner -- commands: - - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/windows/grabpl.exe - -OutFile grabpl.exe - image: grafana/ci-wix:0.1.1 - name: windows-init -- commands: - - $$gcpKey = $$env:GCP_KEY - - '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey)) - > gcpkey.json' - - dos2unix gcpkey.json - - gcloud auth activate-service-account --key-file=gcpkey.json - - rm gcpkey.json - - cp C:\App\nssm-2.24.zip . - - .\grabpl.exe windows-installer --target gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/oss/release/grafana-${DRONE_TAG:1}.windows-amd64.zip - --edition oss ${DRONE_TAG} - - $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0] - - gsutil cp $$fname gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/oss/release/ - - gsutil cp "$$fname.sha256" gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/oss/release/ - depends_on: - - windows-init - environment: - GCP_KEY: - from_secret: gcp_key - GITHUB_TOKEN: - from_secret: github_token - PRERELEASE_BUCKET: - from_secret: prerelease_bucket - image: grafana/ci-wix:0.1.1 - name: build-windows-installer -trigger: - event: - exclude: - - promote - ref: - exclude: - - refs/tags/*-cloud* - include: - - refs/tags/v* -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- -clone: - retries: 3 -depends_on: [] -environment: - EDITION: oss -image_pull_secrets: -- dockerconfigjson -kind: pipeline name: publish-docker-public node: type: no-parallel @@ -3344,13 +2792,13 @@ volumes: --- clone: retries: 3 -depends_on: -- release-build-e2e-publish -- release-windows +depends_on: [] +environment: + EDITION: oss image_pull_secrets: - dockerconfigjson kind: pipeline -name: verify-prerelease-assets +name: release-whatsnew-checker node: type: no-parallel platform: @@ -3359,21 +2807,157 @@ platform: services: [] steps: - commands: - - 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 >> /tmp/stat.log - - '! cat /tmp/stat.log | grep "No URLs matched"' - depends_on: - - clone + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] environment: - BUCKET: - from_secret: prerelease_bucket - GCP_KEY: - from_secret: gcp_key - failure: ignore - image: google/cloud-sdk:431.0.0 - name: gsutil-stat + CGO_ENABLED: 0 + image: golang:1.20.6 + name: compile-build-cmd +- commands: + - ./bin/build whatsnew-checker + depends_on: + - compile-build-cmd + image: golang:1.20.6 + name: whats-new-checker +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +--- +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- dockerconfigjson +kind: pipeline +name: release-test-frontend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.17.1 + name: identify-runner +- commands: + - mkdir -p bin + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl + - chmod +x bin/grabpl + image: byrnedo/alpine-curl:0.1.8 + name: grabpl +- commands: + - yarn install --immutable + depends_on: [] + image: grafana/build-container:1.7.5 + name: yarn-install +- commands: + - yarn betterer ci + depends_on: + - yarn-install + image: grafana/build-container:1.7.5 + name: betterer-frontend +- commands: + - yarn run ci:test-frontend + depends_on: + - yarn-install + environment: + TEST_MAX_WORKERS: 50% + image: grafana/build-container:1.7.5 + name: test-frontend +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +--- +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- dockerconfigjson +kind: pipeline +name: release-test-backend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.17.1 + name: identify-runner +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.20.6 + name: compile-build-cmd +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: grafana/build-container:1.7.5 + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: grafana/build-container:1.7.5 + name: verify-gen-jsonnet +- commands: + - make gen-go + depends_on: + - verify-gen-cue + image: grafana/build-container:1.7.5 + name: wire-install +- commands: + - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... + depends_on: + - wire-install + image: grafana/build-container:1.7.5 + name: test-backend +- commands: + - go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + image: grafana/build-container:1.7.5 + name: test-backend-integration trigger: event: exclude: @@ -3414,7 +2998,7 @@ steps: DESTINATION: from_secret: destination GCP_KEY_BASE64: - from_secret: gcp_key_base64 + from_secret: rgm_global_gcp_key_base64 GITHUB_TOKEN: from_secret: github_token GPG_PASSPHRASE: @@ -3447,7 +3031,9 @@ volumes: --- clone: retries: 3 -depends_on: [] +depends_on: +- release-test-backend +- release-test-frontend image_pull_secrets: - dockerconfigjson kind: pipeline @@ -3468,7 +3054,7 @@ steps: DESTINATION: from_secret: destination GCP_KEY_BASE64: - from_secret: gcp_key_base64 + from_secret: rgm_global_gcp_key_base64 GITHUB_TOKEN: from_secret: github_token GPG_PASSPHRASE: @@ -3532,11 +3118,11 @@ steps: - gcloud auth activate-service-account --key-file=gcpkey.json - rm gcpkey.json - cp C:\App\nssm-2.24.zip . - - .\grabpl.exe windows-installer --target gs://grafana-prerelease-dev/artifacts/downloads/${DRONE_TAG}/oss/release/grafana-${DRONE_TAG:1}.windows-amd64.zip + - .\grabpl.exe windows-installer --target gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/grafana-${DRONE_TAG:1}.windows-amd64.zip --edition oss ${DRONE_TAG} - $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0] - - gsutil cp $$fname gs://grafana-prerelease-dev/artifacts/downloads/${DRONE_TAG}/oss/release/ - - gsutil cp "$$fname.sha256" gs://grafana-prerelease-dev/artifacts/downloads/${DRONE_TAG}/oss/release/ + - gsutil cp $$fname gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/ + - gsutil cp "$$fname.sha256" gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/ depends_on: - windows-init environment: @@ -3589,7 +3175,7 @@ steps: depends_on: - clone environment: - BUCKET: grafana-prerelease-dev + BUCKET: grafana-prerelease GCP_KEY: from_secret: gcp_key failure: ignore @@ -4931,6 +4517,12 @@ get: kind: secret name: gcp_key_base64 --- +get: + name: gcp_global_service_account_base64 + path: infra/data/ci/grafana-release-eng/rgm +kind: secret +name: rgm_global_gcp_key_base64 +--- get: name: destination path: infra/data/ci/grafana-release-eng/rgm @@ -4968,6 +4560,6 @@ kind: secret name: delivery-bot-app-private-key --- kind: signature -hmac: 171ee57a344cc5faf219415c40714ca928e96d135f54282da73cde6cb778478e +hmac: 02436ad63fea0cc66112ef6d9fe06c47059419ecca7f52a0410f964f581da2b0 ... diff --git a/scripts/drone/rgm.star b/scripts/drone/rgm.star index 22dbd2dc6e0..7a02e147d03 100644 --- a/scripts/drone/rgm.star +++ b/scripts/drone/rgm.star @@ -17,17 +17,29 @@ load( "scripts/drone/events/release.star", "verify_release_pipeline", ) +load( + "scripts/drone/pipelines/test_frontend.star", + "test_frontend", +) +load( + "scripts/drone/pipelines/test_backend.star", + "test_backend", +) +load( + "scripts/drone/pipelines/whats_new_checker.star", + "whats_new_checker_pipeline", +) load( "scripts/drone/vault.star", "from_secret", "rgm_dagger_token", "rgm_destination", - "rgm_gcp_key_base64", "rgm_github_token", + "rgm_global_gcp_key_base64", ) rgm_env_secrets = { - "GCP_KEY_BASE64": from_secret(rgm_gcp_key_base64), + "GCP_KEY_BASE64": from_secret(rgm_global_gcp_key_base64), "DESTINATION": from_secret(rgm_destination), "GITHUB_TOKEN": from_secret(rgm_github_token), "_EXPERIMENTAL_DAGGER_CLOUD_TOKEN": from_secret(rgm_dagger_token), @@ -36,6 +48,31 @@ rgm_env_secrets = { "GPG_PASSPHRASE": from_secret("packages_gpg_passphrase"), } +docs_paths = { + "exclude": [ + "*.md", + "docs/**", + "packages/**/*.md", + "latest.json", + ], +} + +tag_trigger = { + "event": { + "exclude": [ + "promote", + ], + }, + "ref": { + "include": [ + "refs/tags/v*", + ], + "exclude": [ + "refs/tags/*-cloud*", + ], + }, +} + def rgm_build(script = "drone_publish_main.sh"): rgm_build_step = { "name": "rgm-build", @@ -55,15 +92,6 @@ def rgm_build(script = "drone_publish_main.sh"): rgm_build_step, ] -docs_paths = { - "exclude": [ - "*.md", - "docs/**", - "packages/**/*.md", - "latest.json", - ], -} - def rgm_main(): trigger = { "event": [ @@ -80,28 +108,12 @@ def rgm_main(): depends_on = ["main-test-backend", "main-test-frontend"], ) -tag_trigger = { - "event": { - "exclude": [ - "promote", - ], - }, - "ref": { - "include": [ - "refs/tags/v*", - ], - "exclude": [ - "refs/tags/*-cloud*", - ], - }, -} - def rgm_tag(): return pipeline( name = "rgm-tag-prerelease", trigger = tag_trigger, steps = rgm_build(script = "drone_publish_tag_grafana.sh"), - depends_on = [], + depends_on = ["release-test-backend", "release-test-frontend"], ) def rgm_windows(): @@ -111,7 +123,7 @@ def rgm_windows(): steps = ignore_failure( get_windows_steps( ver_mode = "release", - bucket = "grafana-prerelease-dev", + bucket = "grafana-prerelease", ), ), depends_on = ["rgm-tag-prerelease"], @@ -120,13 +132,16 @@ def rgm_windows(): def rgm(): return [ + whats_new_checker_pipeline(tag_trigger), + test_frontend(tag_trigger, "release"), + test_backend(tag_trigger, "release"), rgm_main(), rgm_tag(), rgm_windows(), verify_release_pipeline( trigger = tag_trigger, name = "rgm-tag-verify-prerelease-assets", - bucket = "grafana-prerelease-dev", + bucket = "grafana-prerelease", depends_on = [ "rgm-tag-prerelease", "rgm-tag-prerelease-windows", diff --git a/scripts/drone/vault.star b/scripts/drone/vault.star index 9386aa256a6..f6c62965a5e 100644 --- a/scripts/drone/vault.star +++ b/scripts/drone/vault.star @@ -12,6 +12,7 @@ azure_sp_app_id = "azure_sp_app_id" azure_sp_app_pw = "azure_sp_app_pw" azure_tenant = "azure_tenant" +rgm_global_gcp_key_base64 = "rgm_global_gcp_key_base64" rgm_gcp_key_base64 = "gcp_key_base64" rgm_destination = "destination" rgm_github_token = "github_token" @@ -110,6 +111,11 @@ def secrets(): "infra/data/ci/grafana-release-eng/rgm", "gcp_service_account_base64", ), + vault_secret( + rgm_global_gcp_key_base64, + "infra/data/ci/grafana-release-eng/rgm", + "gcp_global_service_account_base64", + ), vault_secret( rgm_destination, "infra/data/ci/grafana-release-eng/rgm",