From 68fe9e343142d3340ef3fc99d789974671c7d3be Mon Sep 17 00:00:00 2001 From: Dimitris Sotirakis Date: Thu, 15 Jul 2021 10:49:19 +0300 Subject: [PATCH] [v8.0.x] Backport 36759 to v8.0.x (#36774) * Delete verify-drone from windows * Sync drone yaml * Downgrade grabpl version * Move publish-frontend-metrics step --- .drone.yml | 65 +++++++++++++++++++++-------------------------- scripts/lib.star | 42 +++++++++++++++--------------- scripts/main.star | 2 +- 3 files changed, 50 insertions(+), 59 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1de4de7468f..ae06ec2ff26 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,7 +17,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - ./bin/grabpl verify-drone - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz @@ -258,7 +258,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - ./bin/grabpl verify-drone - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz @@ -323,17 +323,6 @@ steps: depends_on: - initialize -- name: publish-frontend-metrics - image: grafana/build-container:1.4.1 - commands: - - ./scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY} - environment: - GRAFANA_MISC_STATS_API_KEY: - from_secret: grafana_misc_stats_api_key - failure: ignore - depends_on: - - initialize - - name: build-backend image: grafana/build-container:1.4.1 commands: @@ -351,6 +340,17 @@ steps: - initialize - test-frontend +- name: publish-frontend-metrics + image: grafana/build-container:1.4.1 + commands: + - ./scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY} + environment: + GRAFANA_MISC_STATS_API_KEY: + from_secret: grafana_misc_stats_api_key + failure: ignore + depends_on: + - build-frontend + - name: build-plugins image: grafana/build-container:1.4.1 commands: @@ -589,8 +589,7 @@ steps: image: grafana/ci-wix:0.1.1 commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/windows/grabpl.exe -OutFile grabpl.exe - - .\grabpl.exe verify-drone + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/windows/grabpl.exe -OutFile grabpl.exe - name: build-windows-installer image: grafana/ci-wix:0.1.1 @@ -639,7 +638,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - ./bin/grabpl verify-drone environment: @@ -724,7 +723,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - ./bin/grabpl verify-drone - ./bin/grabpl verify-version ${DRONE_TAG} @@ -1030,8 +1029,7 @@ steps: image: grafana/ci-wix:0.1.1 commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/windows/grabpl.exe -OutFile grabpl.exe - - .\grabpl.exe verify-drone + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/windows/grabpl.exe -OutFile grabpl.exe - name: build-windows-installer image: grafana/ci-wix:0.1.1 @@ -1081,7 +1079,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise @@ -1506,7 +1504,7 @@ steps: image: grafana/ci-wix:0.1.1 commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/windows/grabpl.exe -OutFile grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/windows/grabpl.exe -OutFile grabpl.exe - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise - git checkout ${DRONE_TAG} @@ -1523,7 +1521,6 @@ steps: - rm -force grabpl.exe - C:\App\grabpl.exe init-enterprise C:\App\grafana-enterprise - cp C:\App\grabpl.exe grabpl.exe - - .\grabpl.exe verify-drone depends_on: - clone @@ -1575,7 +1572,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - ./bin/grabpl verify-drone - ./bin/grabpl verify-version ${DRONE_TAG} @@ -1680,7 +1677,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - ./bin/grabpl verify-drone - ./bin/grabpl verify-version v7.3.0-test @@ -1975,8 +1972,7 @@ steps: image: grafana/ci-wix:0.1.1 commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/windows/grabpl.exe -OutFile grabpl.exe - - .\grabpl.exe verify-drone + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/windows/grabpl.exe -OutFile grabpl.exe - name: build-windows-installer image: grafana/ci-wix:0.1.1 @@ -2026,7 +2022,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise @@ -2445,7 +2441,7 @@ steps: image: grafana/ci-wix:0.1.1 commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/windows/grabpl.exe -OutFile grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/windows/grabpl.exe -OutFile grabpl.exe - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise - git checkout main @@ -2462,7 +2458,6 @@ steps: - rm -force grabpl.exe - C:\App\grabpl.exe init-enterprise C:\App\grafana-enterprise - cp C:\App\grabpl.exe grabpl.exe - - .\grabpl.exe verify-drone depends_on: - clone @@ -2514,7 +2509,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - ./bin/grabpl verify-drone - ./bin/grabpl verify-version v7.3.0-test @@ -2619,7 +2614,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - ./bin/grabpl verify-drone - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz @@ -2889,8 +2884,7 @@ steps: image: grafana/ci-wix:0.1.1 commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/windows/grabpl.exe -OutFile grabpl.exe - - .\grabpl.exe verify-drone + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/windows/grabpl.exe -OutFile grabpl.exe - name: build-windows-installer image: grafana/ci-wix:0.1.1 @@ -2936,7 +2930,7 @@ steps: image: grafana/build-container:1.4.1 commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/grabpl - chmod +x bin/grabpl - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise @@ -3358,7 +3352,7 @@ steps: image: grafana/ci-wix:0.1.1 commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.0.0/windows/grabpl.exe -OutFile grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.2.8/windows/grabpl.exe -OutFile grabpl.exe - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise - git checkout $$env:DRONE_BRANCH @@ -3375,7 +3369,6 @@ steps: - rm -force grabpl.exe - C:\App\grabpl.exe init-enterprise C:\App\grafana-enterprise - cp C:\App\grabpl.exe grabpl.exe - - .\grabpl.exe verify-drone depends_on: - clone diff --git a/scripts/lib.star b/scripts/lib.star index 69a621da11a..33c7d1ac172 100644 --- a/scripts/lib.star +++ b/scripts/lib.star @@ -1,6 +1,6 @@ load('scripts/vault.star', 'from_secret', 'github_token', 'pull_secret') -grabpl_version = '2.0.0' +grabpl_version = '2.2.8' build_image = 'grafana/build-container:1.4.1' publish_image = 'grafana/grafana-ci-deploy:1.3.1' grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2' @@ -435,6 +435,25 @@ def build_plugins_step(edition, sign=False): ], } +def frontend_metrics_step(edition): + if edition in ('enterprise', 'enterprise2'): + return None + + return { + 'name': 'publish-frontend-metrics', + 'image': build_image, + 'depends_on': [ + 'build-frontend', + ], + 'environment': { + 'GRAFANA_MISC_STATS_API_KEY': from_secret('grafana_misc_stats_api_key'), + }, + 'failure': 'ignore', + 'commands': [ + './scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY}', + ], + } + def test_backend_step(edition, tries=None): test_backend_cmd = './bin/grabpl test-backend --edition {}'.format(edition) integration_tests_cmd = './bin/grabpl integration-tests --edition {}'.format(edition) @@ -472,25 +491,6 @@ def test_frontend_step(): ], } -def frontend_metrics_step(edition): - if edition in ('enterprise', 'enterprise2'): - return None - - return { - 'name': 'publish-frontend-metrics', - 'image': build_image, - 'depends_on': [ - 'initialize', - ], - 'environment': { - 'GRAFANA_MISC_STATS_API_KEY': from_secret('grafana_misc_stats_api_key'), - }, - 'failure': 'ignore', - 'commands': [ - './scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY}', - ], - } - def codespell_step(): return { @@ -929,7 +929,6 @@ def get_windows_steps(edition, ver_mode, is_downstream=False): init_cmds.extend([ '$$ProgressPreference = "SilentlyContinue"', 'Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v{}/windows/grabpl.exe -OutFile grabpl.exe'.format(grabpl_version), - '.\\grabpl.exe verify-drone', ]) steps = [ { @@ -1029,7 +1028,6 @@ def get_windows_steps(edition, ver_mode, is_downstream=False): 'rm -force grabpl.exe', 'C:\\App\\grabpl.exe init-enterprise C:\\App\\grafana-enterprise{}'.format(source_commit), 'cp C:\\App\\grabpl.exe grabpl.exe', - '.\\grabpl.exe verify-drone', ]) return steps diff --git a/scripts/main.star b/scripts/main.star index 7041c29335b..60209ac579d 100644 --- a/scripts/main.star +++ b/scripts/main.star @@ -49,9 +49,9 @@ def get_steps(edition, is_downstream=False): test_backend_step(edition=edition), lint_backend_step(edition=edition), test_frontend_step(), - frontend_metrics_step(edition=edition), build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream), build_frontend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream), + frontend_metrics_step(edition=edition), build_plugins_step(edition=edition, sign=True), validate_scuemata(), ]