CI: Make build and store storybook trigger in the release process (#58686)

Make storybook trigger conditional
This commit is contained in:
Dimitris Sotirakis
2022-11-14 11:14:50 +01:00
committed by GitHub
parent b0c197b966
commit 09c3ead945
2 changed files with 23 additions and 16 deletions

View File

@@ -16,13 +16,6 @@ trigger_oss = {
'grafana/grafana',
]
}
trigger_storybook = {
'paths': {
'include': [
'packages/grafana-ui/**',
],
}
}
def slack_step(channel, template, secret):
@@ -259,7 +252,7 @@ def build_storybook_step(edition, ver_mode):
'yarn storybook:build',
'./bin/grabpl verify-storybook',
],
'when': trigger_storybook,
'when': get_trigger_storybook(ver_mode),
}
@@ -287,7 +280,7 @@ def store_storybook_step(edition, ver_mode, trigger=None):
'PRERELEASE_BUCKET': from_secret(prerelease_bucket)
},
'commands': commands,
'when': trigger_storybook,
'when': get_trigger_storybook(ver_mode),
}
if trigger and ver_mode in ("release-branch", "main"):
# no dict merge operation available, https://github.com/harness/drone-cli/pull/220
@@ -1282,3 +1275,19 @@ def compile_build_cmd(edition='oss'):
'CGO_ENABLED': 0,
},
}
def get_trigger_storybook(ver_mode):
trigger_storybook = ''
if ver_mode == 'release':
trigger_storybook = {
'event': ['tag']
}
else:
trigger_storybook = {
'paths': {
'include': [
'packages/grafana-ui/**',
],
}
}
return trigger_storybook