Skip to content

Commit 09c3ead

Browse files
authored
CI: Make build and store storybook trigger in the release process (grafana#58686)
Make storybook trigger conditional
1 parent b0c197b commit 09c3ead

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

.drone.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,9 +2132,8 @@ steps:
21322132
image: grafana/build-container:1.6.5
21332133
name: build-storybook
21342134
when:
2135-
paths:
2136-
include:
2137-
- packages/grafana-ui/**
2135+
event:
2136+
- tag
21382137
- commands:
21392138
- ./bin/grabpl upload-cdn --edition oss
21402139
depends_on:
@@ -2177,9 +2176,8 @@ steps:
21772176
image: grafana/grafana-ci-deploy:1.3.3
21782177
name: store-storybook
21792178
when:
2180-
paths:
2181-
include:
2182-
- packages/grafana-ui/**
2179+
event:
2180+
- tag
21832181
- commands:
21842182
- ./bin/grabpl artifacts npm store --tag ${DRONE_TAG}
21852183
depends_on:
@@ -5514,6 +5512,6 @@ kind: secret
55145512
name: packages_secret_access_key
55155513
---
55165514
kind: signature
5517-
hmac: 1d42ccac383b4cacb1a626ffdc71847208cca3b464a5ba80e012703b47d2b347
5515+
hmac: 4f5e09af0ec5a9d59c5e31333bf180dd52cba1ad2780d96a62d20583113ccb16
55185516

55195517
...

scripts/drone/steps/lib.star

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ trigger_oss = {
1616
'grafana/grafana',
1717
]
1818
}
19-
trigger_storybook = {
20-
'paths': {
21-
'include': [
22-
'packages/grafana-ui/**',
23-
],
24-
}
25-
}
2619

2720

2821
def slack_step(channel, template, secret):
@@ -259,7 +252,7 @@ def build_storybook_step(edition, ver_mode):
259252
'yarn storybook:build',
260253
'./bin/grabpl verify-storybook',
261254
],
262-
'when': trigger_storybook,
255+
'when': get_trigger_storybook(ver_mode),
263256
}
264257

265258

@@ -287,7 +280,7 @@ def store_storybook_step(edition, ver_mode, trigger=None):
287280
'PRERELEASE_BUCKET': from_secret(prerelease_bucket)
288281
},
289282
'commands': commands,
290-
'when': trigger_storybook,
283+
'when': get_trigger_storybook(ver_mode),
291284
}
292285
if trigger and ver_mode in ("release-branch", "main"):
293286
# no dict merge operation available, https://github.com/harness/drone-cli/pull/220
@@ -1282,3 +1275,19 @@ def compile_build_cmd(edition='oss'):
12821275
'CGO_ENABLED': 0,
12831276
},
12841277
}
1278+
1279+
def get_trigger_storybook(ver_mode):
1280+
trigger_storybook = ''
1281+
if ver_mode == 'release':
1282+
trigger_storybook = {
1283+
'event': ['tag']
1284+
}
1285+
else:
1286+
trigger_storybook = {
1287+
'paths': {
1288+
'include': [
1289+
'packages/grafana-ui/**',
1290+
],
1291+
}
1292+
}
1293+
return trigger_storybook

0 commit comments

Comments
 (0)