From 396ff9f478b32fda5f8e7396e0de23873a69f7c5 Mon Sep 17 00:00:00 2001 From: Arve Knudsen Date: Fri, 10 Jul 2020 17:24:12 +0200 Subject: [PATCH] Drone: Disable enterprise build for PRs (#26241) Signed-off-by: Arve Knudsen --- .drone.star | 14 +++++-- .drone.yml | 115 ---------------------------------------------------- 2 files changed, 10 insertions(+), 119 deletions(-) diff --git a/.drone.star b/.drone.star index 15780a6f28c..4ea1b25ba2a 100644 --- a/.drone.star +++ b/.drone.star @@ -52,7 +52,7 @@ def pipeline_set(kind, name): # There should be a 'fail' function in Starlark, but won't build return [] - return [ + pipelines = [ { 'kind': 'pipeline', 'type': 'docker', @@ -370,7 +370,12 @@ def pipeline_set(kind, name): }, ], }, - { + ] + + if kind != pr_kind: + # For now at least, we have to disable the enterprise pipeline for PRs, since PRs don't have access + # to secrets with Drone (in Circle, you can share secrets with PRs internal to the repo). + pipelines.append({ 'kind': 'pipeline', 'type': 'docker', 'name': '{}-enterprise'.format(name), @@ -484,5 +489,6 @@ def pipeline_set(kind, name): # }, # }, ] - }, - ] + }) + + return pipelines diff --git a/.drone.yml b/.drone.yml index 2afaf39cd10..12922457de7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -233,119 +233,4 @@ trigger: event: - pull_request ---- -kind: pipeline -type: docker -name: test-pr-enterprise - -platform: - os: linux - arch: amd64 - -steps: -- name: install-deps - image: grafana/build-container:1.2.21 - commands: - - curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v$${GRABPL_VERSION}/grabpl - - chmod +x grabpl - - mkdir -p bin - - mv grabpl bin - - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - yarn install --frozen-lockfile --no-progress - - cp -r $(yarn cache dir) yarn-cache - environment: - DOCKERIZE_VERSION: 0.6.1 - GRABPL_VERSION: 0.4.15 - when: - repo: - - grafana/grafana - - aknuds1/grafana - -- name: build-backend - image: grafana/build-container:1.2.21 - commands: - - ./bin/grabpl build-backend --github-token "$${GITHUB_TOKEN}" --edition enterprise --build-id $DRONE_BUILD_NUMBER --variants linux-x64,linux-x64-musl,osx64,win64 - environment: - GITHUB_TOKEN: - from_secret: github_token - when: - repo: - - grafana/grafana - - aknuds1/grafana - depends_on: - - install-deps - -- name: build-frontend - image: grafana/build-container:1.2.21 - commands: - - rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir) - - ./bin/grabpl build-frontend --no-install-deps --github-token "$${GITHUB_TOKEN}" --edition enterprise --build-id $DRONE_BUILD_NUMBER - environment: - GITHUB_TOKEN: - from_secret: github_token - when: - repo: - - grafana/grafana - - aknuds1/grafana - depends_on: - - install-deps - -- name: build-plugins - image: grafana/build-container:1.2.21 - commands: - - rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir) - - ./bin/grabpl build-plugins --edition enterprise --no-install-deps - when: - repo: - - grafana/grafana - - aknuds1/grafana - depends_on: - - install-deps - -- name: package - image: grafana/build-container:1.2.21 - commands: - - . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --github-token "$${GITHUB_TOKEN}" --edition enterprise --build-id $DRONE_BUILD_NUMBER --variants linux-x64,linux-x64-musl,osx64,win64 - environment: - GITHUB_TOKEN: - from_secret: github_token - when: - repo: - - grafana/grafana - - aknuds1/grafana - depends_on: - - build-backend - - build-frontend - - build-plugins - -- name: copy-packages-for-docker - image: grafana/build-container:1.2.21 - commands: - - cp dist/*.tar.gz packaging/docker/ - when: - repo: - - grafana/grafana - - aknuds1/grafana - depends_on: - - package - -- name: build-docker-images - image: grafana/drone-grafana-docker:0.2.0 - settings: - archs: amd64 - dry_run: true - edition: enterprise - when: - repo: - - grafana/grafana - - aknuds1/grafana - depends_on: - - copy-packages-for-docker - -trigger: - event: - - pull_request - ...