mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Drone: Fix StoryBook build (#26408)
* Drone: Fix StoryBook build Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Fix StoryBook publishing Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
10
.drone.yml
10
.drone.yml
@@ -373,14 +373,20 @@ steps:
|
||||
commands:
|
||||
- rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir)
|
||||
- yarn storybook:build
|
||||
depends_on:
|
||||
- package
|
||||
|
||||
- name: publish-storybook
|
||||
image: grafana/grafana-ci-deploy:1.2.5
|
||||
commands:
|
||||
- echo $${GCP_KEY} > /tmp/gcpkey.json
|
||||
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
|
||||
- gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/canary
|
||||
- echo gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/canary
|
||||
environment:
|
||||
GCP_KEY:
|
||||
from_secret: gcp_key
|
||||
depends_on:
|
||||
- package
|
||||
- build-storybook
|
||||
|
||||
- name: build-docs-website
|
||||
image: grafana/docs-base:latest
|
||||
|
||||
@@ -96,7 +96,8 @@ def master_pipelines(edition):
|
||||
package_step(edition=edition),
|
||||
e2e_tests_server_step(),
|
||||
e2e_tests_step(),
|
||||
build_storybook_step(edition=edition, publish=True),
|
||||
build_storybook_step(edition=edition),
|
||||
publish_storybook_step(edition=edition),
|
||||
build_docs_website_step(),
|
||||
copy_packages_for_docker_step(),
|
||||
build_docker_images_step(edition=edition),
|
||||
@@ -220,24 +221,7 @@ def lint_backend_step(edition):
|
||||
],
|
||||
}
|
||||
|
||||
def build_storybook_step(edition, publish=False):
|
||||
commands = [
|
||||
restore_yarn_cache,
|
||||
'yarn storybook:build',
|
||||
]
|
||||
env = {}
|
||||
if edition != 'enterprise' and publish:
|
||||
commands.extend([
|
||||
'echo $${GCP_KEY} > /tmp/gcpkey.json',
|
||||
'gcloud auth activate-service-account --key-file=/tmp/gcpkey.json',
|
||||
'gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/canary',
|
||||
])
|
||||
env = {
|
||||
'GCP_KEY': {
|
||||
'from_secret': 'gcp_key',
|
||||
},
|
||||
}
|
||||
|
||||
def build_storybook_step(edition):
|
||||
return {
|
||||
'name': 'build-storybook',
|
||||
'image': build_image,
|
||||
@@ -245,8 +229,32 @@ def build_storybook_step(edition, publish=False):
|
||||
# Best to ensure that this step doesn't mess with what's getting built and packaged
|
||||
'package',
|
||||
],
|
||||
'environment': env,
|
||||
'commands': commands,
|
||||
'commands': [
|
||||
restore_yarn_cache,
|
||||
'yarn storybook:build',
|
||||
],
|
||||
}
|
||||
|
||||
def publish_storybook_step(edition):
|
||||
if edition == 'enterprise':
|
||||
return None
|
||||
|
||||
return {
|
||||
'name': 'publish-storybook',
|
||||
'image': publish_image,
|
||||
'depends_on': [
|
||||
'build-storybook',
|
||||
],
|
||||
'environment': {
|
||||
'GCP_KEY': {
|
||||
'from_secret': 'gcp_key',
|
||||
},
|
||||
},
|
||||
'commands': [
|
||||
'echo $${GCP_KEY} > /tmp/gcpkey.json',
|
||||
'gcloud auth activate-service-account --key-file=/tmp/gcpkey.json',
|
||||
'echo gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/canary',
|
||||
],
|
||||
}
|
||||
|
||||
def build_backend_step(edition, variants=None):
|
||||
|
||||
Reference in New Issue
Block a user