Skip to content

Commit

Permalink
Build: only specify github-token when needed (grafana#45326)
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmholmes committed Feb 11, 2022
1 parent 9e2caa9 commit 9a7438c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3422,7 +3422,7 @@ steps:
- mv bin/grabpl /tmp/
- rmdir bin
- mv grafana-enterprise /tmp/
- /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
- mkdir bin
- mv /tmp/grabpl bin/
Expand Down Expand Up @@ -3755,7 +3755,7 @@ steps:
- mv bin/grabpl /tmp/
- rmdir bin
- mv grafana-enterprise /tmp/
- /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
- mkdir bin
- mv /tmp/grabpl bin/
Expand Down Expand Up @@ -3918,7 +3918,7 @@ steps:
- mv bin/grabpl /tmp/
- rmdir bin
- mv grafana-enterprise /tmp/
- /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
- mkdir bin
- mv /tmp/grabpl bin/
Expand Down Expand Up @@ -4212,6 +4212,6 @@ kind: secret
name: gcp_upload_artifacts_key
---
kind: signature
hmac: 1d7c4a778a9dcf8f7f69100cdef990a89ef563383c7b81ea79df1a04b815343d
hmac: 6619036aae90bbf3f04b626f5d107e53d8916aaeac8e780af469358fc31184f7

...
6 changes: 5 additions & 1 deletion scripts/drone/steps/lib.star
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,17 @@ def initialize_step(edition, platform, ver_mode, is_downstream=False, install_de
environment = {
'GITHUB_TOKEN': from_secret(github_token),
}
token = "--github-token $${GITHUB_TOKEN}"
elif ver_mode == 'release-branch':
committish = '${DRONE_BRANCH}'
environment = {}
token = ""
else:
environment = {}
if is_downstream:
source_commit = ' $${SOURCE_COMMIT}'
committish = '${DRONE_COMMIT}'
token = ""
steps = [
identify_runner,
clone_enterprise(committish),
Expand All @@ -88,7 +92,7 @@ def initialize_step(edition, platform, ver_mode, is_downstream=False, install_de
'mv bin/grabpl /tmp/',
'rmdir bin',
'mv grafana-enterprise /tmp/',
'/tmp/grabpl init-enterprise --github-token $${{GITHUB_TOKEN}} /tmp/grafana-enterprise{}'.format(source_commit),
'/tmp/grabpl init-enterprise {} /tmp/grafana-enterprise{}'.format(token, source_commit),
'mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json',
'mkdir bin',
'mv /tmp/grabpl bin/'
Expand Down

0 comments on commit 9a7438c

Please sign in to comment.