From 7593d5880f7be5621d98e39afae8c34d6f8748ef Mon Sep 17 00:00:00 2001 From: Dimitris Sotirakis Date: Wed, 19 Oct 2022 11:37:36 +0300 Subject: [PATCH] Add token to init-enterprise (#57246) (#57248) (cherry picked from commit f0b882ebad2a105a49c0a36f5d4d901be135b824) --- .drone.yml | 32 +++++++++++++++++++++----------- scripts/drone/steps/lib.star | 6 ++++-- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index c4789711795..ee325f62dda 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4625,13 +4625,15 @@ steps: - mv bin/grabpl /tmp/ - rmdir bin - mv grafana-enterprise /tmp/ - - /tmp/grabpl init-enterprise /tmp/grafana-enterprise + - /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise - mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json - mkdir bin - mv /tmp/grabpl bin/ depends_on: - clone-enterprise - environment: {} + environment: + GITHUB_TOKEN: + from_secret: github_token image: grafana/build-container:1.6.3 name: init-enterprise - commands: @@ -4954,13 +4956,15 @@ steps: - mv bin/grabpl /tmp/ - rmdir bin - mv grafana-enterprise /tmp/ - - /tmp/grabpl init-enterprise /tmp/grafana-enterprise + - /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise - mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json - mkdir bin - mv /tmp/grabpl bin/ depends_on: - clone-enterprise - environment: {} + environment: + GITHUB_TOKEN: + from_secret: github_token image: grafana/build-container:1.6.3 name: init-enterprise - commands: @@ -5040,13 +5044,15 @@ steps: - mv bin/grabpl /tmp/ - rmdir bin - mv grafana-enterprise /tmp/ - - /tmp/grabpl init-enterprise /tmp/grafana-enterprise + - /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise - mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json - mkdir bin - mv /tmp/grabpl bin/ depends_on: - clone-enterprise - environment: {} + environment: + GITHUB_TOKEN: + from_secret: github_token image: grafana/build-container:1.6.3 name: init-enterprise - commands: @@ -5133,13 +5139,15 @@ steps: - mv bin/grabpl /tmp/ - rmdir bin - mv grafana-enterprise /tmp/ - - /tmp/grabpl init-enterprise /tmp/grafana-enterprise + - /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise - mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json - mkdir bin - mv /tmp/grabpl bin/ depends_on: - clone-enterprise - environment: {} + environment: + GITHUB_TOKEN: + from_secret: github_token image: grafana/build-container:1.6.3 name: init-enterprise - commands: @@ -5256,13 +5264,15 @@ steps: - mv bin/grabpl /tmp/ - rmdir bin - mv grafana-enterprise /tmp/ - - /tmp/grabpl init-enterprise /tmp/grafana-enterprise + - /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise - mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json - mkdir bin - mv /tmp/grabpl bin/ depends_on: - clone-enterprise - environment: {} + environment: + GITHUB_TOKEN: + from_secret: github_token image: grafana/build-container:1.6.3 name: init-enterprise - commands: @@ -5612,6 +5622,6 @@ kind: secret name: packages_secret_access_key --- kind: signature -hmac: 32fd3238c41c567091d1a3a654de77a138e66a28bf47799c982629960e53d806 +hmac: 170743e634118a20238e3c360d87177b98bb391bb3eb9ff409b3adb78e4686df ... diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 41b84488e13..85806a4444e 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -111,8 +111,10 @@ def init_enterprise_step(ver_mode): } token = "--github-token $${GITHUB_TOKEN}" elif ver_mode == 'release-branch': - environment = {} - token = "" + environment = { + 'GITHUB_TOKEN': from_secret(github_token), + } + token = "--github-token $${GITHUB_TOKEN}" else: environment = {} token = ""