From d76c886de9d6fe0e37007dcab6ff7f6d276ed72e Mon Sep 17 00:00:00 2001 From: Kevin Minehart Date: Fri, 28 Jul 2023 10:31:35 -0500 Subject: [PATCH] [v10.0.x] CI: Make RGM the main pipeline for prerelease (#72532) CI: Make RGM the main pipeline for prerelease (#72295) * Make RGM the main pipeline for prerelease * Use grafana/grafana-build:dev-bd41660 * Use grafana/grafana-build:dev-fda506a * Fix destination url * Update vault secrets * Move bucket path to environment * Use grafana/grafana-build:dev-2f36afa * Revert to grafana/grafana-build:main * Add repo to rgm_main trigger (cherry picked from commit 971f5f14be87cf1d346e1235a5b90e106e553a57) Co-authored-by: Guilherme Caulada --- .drone.star | 6 +- .drone.yml | 794 ++++++++++----------------------------- scripts/drone/rgm.star | 74 ++-- scripts/drone/vault.star | 4 +- 4 files changed, 240 insertions(+), 638 deletions(-) diff --git a/.drone.star b/.drone.star index b187ee88abb..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,17 +41,15 @@ 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"], "target": ["test-windows"], }, "oss", "testing")] + - rgm() + version_branch_pipelines() + integration_test_pipelines() + publish_ci_windows_test_image_pipeline() + diff --git a/.drone.yml b/.drone.yml index faf46b790d3..73fb10ff7e2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2167,558 +2167,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_grafanauploads_base64 - 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 @@ -3041,13 +2489,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: @@ -3056,21 +2504,18 @@ 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: @@ -3087,55 +2532,142 @@ volumes: name: docker --- clone: - disable: true + retries: 3 depends_on: [] environment: EDITION: oss image_pull_secrets: - dockerconfigjson kind: pipeline -name: testing-test-backend-windows +name: release-test-frontend +node: + type: no-parallel platform: arch: amd64 - os: windows - version: "1809" + os: linux services: [] steps: - commands: - - git clone "https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git" . - - git checkout -f $$env:DRONE_COMMIT - environment: - GITHUB_TOKEN: - from_secret: github_token - image: grafana/ci-wix:0.1.1 - name: clone -- commands: [] - depends_on: - - clone - image: grafana/grafana-ci-windows-test:0.1.0 - name: windows-init + - echo $DRONE_RUNNER_NAME + image: alpine:3.17.1 + name: identify-runner - commands: - - go install github.com/google/wire/cmd/wire@v0.5.0 - - wire gen -tags oss ./pkg/server + - 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: - - windows-init - image: grafana/grafana-ci-windows-test:0.1.0 + - 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/grafana-ci-windows-test:0.1.0 + 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: - - promote - target: - - test-windows + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* type: docker volumes: - host: - path: //./pipe/docker_engine/ + path: /var/run/docker.sock name: docker --- clone: @@ -3188,6 +2720,8 @@ trigger: - docs/** - packages/**/*.md - latest.json + repo: + - grafana/grafana type: docker volumes: - host: @@ -3196,7 +2730,9 @@ volumes: --- clone: retries: 3 -depends_on: [] +depends_on: +- release-test-backend +- release-test-frontend image_pull_secrets: - dockerconfigjson kind: pipeline @@ -3281,11 +2817,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: @@ -3338,7 +2874,7 @@ steps: depends_on: - clone environment: - BUCKET: grafana-prerelease-dev + BUCKET: grafana-prerelease GCP_KEY: from_secret: gcp_key failure: ignore @@ -3359,6 +2895,58 @@ volumes: path: /var/run/docker.sock name: docker --- +clone: + disable: true +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- dockerconfigjson +kind: pipeline +name: testing-test-backend-windows +platform: + arch: amd64 + os: windows + version: "1809" +services: [] +steps: +- commands: + - git clone "https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git" . + - git checkout -f $$env:DRONE_COMMIT + environment: + GITHUB_TOKEN: + from_secret: github_token + image: grafana/ci-wix:0.1.1 + name: clone +- commands: [] + depends_on: + - clone + image: grafana/grafana-ci-windows-test:0.1.0 + name: windows-init +- commands: + - go install github.com/google/wire/cmd/wire@v0.5.0 + - wire gen -tags oss ./pkg/server + depends_on: + - windows-init + image: grafana/grafana-ci-windows-test:0.1.0 + name: wire-install +- commands: + - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... + depends_on: + - wire-install + image: grafana/grafana-ci-windows-test:0.1.0 + name: test-backend +trigger: + event: + - promote + target: + - test-windows +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker +--- clone: retries: 3 depends_on: [] @@ -4570,13 +4158,13 @@ kind: secret name: enterprise2_security_prefix --- get: - name: gcp_service_account_base64 + name: gcp_service_account_prod_base64 path: infra/data/ci/grafana-release-eng/rgm kind: secret name: gcp_key_base64 --- get: - name: destination + name: destination_prod path: infra/data/ci/grafana-release-eng/rgm kind: secret name: destination @@ -4612,6 +4200,6 @@ kind: secret name: delivery-bot-app-private-key --- kind: signature -hmac: 17c1232cfce7e56f1dcbe1dc798adfe9fc40d336846d01aa9be598f66b22a2c6 +hmac: 3da91b7343f684af1ea5189ebafc0730135dfb0a3f76e046a54d7462fa542129 ... diff --git a/scripts/drone/rgm.star b/scripts/drone/rgm.star index 22dbd2dc6e0..e6851373103 100644 --- a/scripts/drone/rgm.star +++ b/scripts/drone/rgm.star @@ -17,6 +17,18 @@ 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", @@ -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": [ @@ -71,6 +99,9 @@ def rgm_main(): ], "branch": "main", "paths": docs_paths, + "repo": [ + "grafana/grafana", + ], } return pipeline( @@ -80,28 +111,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 +126,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 +135,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 9d00f096855..620a669deb2 100644 --- a/scripts/drone/vault.star +++ b/scripts/drone/vault.star @@ -123,12 +123,12 @@ def secrets(): vault_secret( rgm_gcp_key_base64, "infra/data/ci/grafana-release-eng/rgm", - "gcp_service_account_base64", + "gcp_service_account_prod_base64", ), vault_secret( rgm_destination, "infra/data/ci/grafana-release-eng/rgm", - "destination", + "destination_prod", ), vault_secret( rgm_dagger_token,