Skip to content

Commit f0b882e

Browse files
authored
Add token to init-enterprise (grafana#57246)
1 parent 8949e57 commit f0b882e

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

.drone.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4591,13 +4591,15 @@ steps:
45914591
- mv bin/grabpl /tmp/
45924592
- rmdir bin
45934593
- mv grafana-enterprise /tmp/
4594-
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
4594+
- /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise
45954595
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
45964596
- mkdir bin
45974597
- mv /tmp/grabpl bin/
45984598
depends_on:
45994599
- clone-enterprise
4600-
environment: {}
4600+
environment:
4601+
GITHUB_TOKEN:
4602+
from_secret: github_token
46014603
image: grafana/build-container:1.6.3
46024604
name: init-enterprise
46034605
- commands:
@@ -4920,13 +4922,15 @@ steps:
49204922
- mv bin/grabpl /tmp/
49214923
- rmdir bin
49224924
- mv grafana-enterprise /tmp/
4923-
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
4925+
- /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise
49244926
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
49254927
- mkdir bin
49264928
- mv /tmp/grabpl bin/
49274929
depends_on:
49284930
- clone-enterprise
4929-
environment: {}
4931+
environment:
4932+
GITHUB_TOKEN:
4933+
from_secret: github_token
49304934
image: grafana/build-container:1.6.3
49314935
name: init-enterprise
49324936
- commands:
@@ -5005,13 +5009,15 @@ steps:
50055009
- mv bin/grabpl /tmp/
50065010
- rmdir bin
50075011
- mv grafana-enterprise /tmp/
5008-
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
5012+
- /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise
50095013
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
50105014
- mkdir bin
50115015
- mv /tmp/grabpl bin/
50125016
depends_on:
50135017
- clone-enterprise
5014-
environment: {}
5018+
environment:
5019+
GITHUB_TOKEN:
5020+
from_secret: github_token
50155021
image: grafana/build-container:1.6.3
50165022
name: init-enterprise
50175023
- commands:
@@ -5098,13 +5104,15 @@ steps:
50985104
- mv bin/grabpl /tmp/
50995105
- rmdir bin
51005106
- mv grafana-enterprise /tmp/
5101-
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
5107+
- /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise
51025108
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
51035109
- mkdir bin
51045110
- mv /tmp/grabpl bin/
51055111
depends_on:
51065112
- clone-enterprise
5107-
environment: {}
5113+
environment:
5114+
GITHUB_TOKEN:
5115+
from_secret: github_token
51085116
image: grafana/build-container:1.6.3
51095117
name: init-enterprise
51105118
- commands:
@@ -5221,13 +5229,15 @@ steps:
52215229
- mv bin/grabpl /tmp/
52225230
- rmdir bin
52235231
- mv grafana-enterprise /tmp/
5224-
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
5232+
- /tmp/grabpl init-enterprise --github-token $${GITHUB_TOKEN} /tmp/grafana-enterprise
52255233
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
52265234
- mkdir bin
52275235
- mv /tmp/grabpl bin/
52285236
depends_on:
52295237
- clone-enterprise
5230-
environment: {}
5238+
environment:
5239+
GITHUB_TOKEN:
5240+
from_secret: github_token
52315241
image: grafana/build-container:1.6.3
52325242
name: init-enterprise
52335243
- commands:
@@ -5608,6 +5618,6 @@ kind: secret
56085618
name: packages_secret_access_key
56095619
---
56105620
kind: signature
5611-
hmac: f74313ae5345e0a4bc07b46794ba73ef902d5f651e81f45e07bfba2390208644
5621+
hmac: 015389b7bbd46fbb8042817bd41a320c71744023710a1bdfb815b9cb28ddd7e3
56125622

56135623
...

scripts/drone/steps/lib.star

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ def init_enterprise_step(ver_mode):
111111
}
112112
token = "--github-token $${GITHUB_TOKEN}"
113113
elif ver_mode == 'release-branch':
114-
environment = {}
115-
token = ""
114+
environment = {
115+
'GITHUB_TOKEN': from_secret(github_token),
116+
}
117+
token = "--github-token $${GITHUB_TOKEN}"
116118
else:
117119
environment = {}
118120
token = ""

0 commit comments

Comments
 (0)