Commit f003e3b0 by Arve Knudsen Committed by GitHub

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>
parent 528a61b8
...@@ -373,14 +373,20 @@ steps: ...@@ -373,14 +373,20 @@ steps:
commands: commands:
- rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir) - rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir)
- yarn storybook:build - yarn storybook:build
depends_on:
- package
- name: publish-storybook
image: grafana/grafana-ci-deploy:1.2.5
commands:
- echo $${GCP_KEY} > /tmp/gcpkey.json - echo $${GCP_KEY} > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/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: environment:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
depends_on: depends_on:
- package - build-storybook
- name: build-docs-website - name: build-docs-website
image: grafana/docs-base:latest image: grafana/docs-base:latest
......
...@@ -96,7 +96,8 @@ def master_pipelines(edition): ...@@ -96,7 +96,8 @@ def master_pipelines(edition):
package_step(edition=edition), package_step(edition=edition),
e2e_tests_server_step(), e2e_tests_server_step(),
e2e_tests_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(), build_docs_website_step(),
copy_packages_for_docker_step(), copy_packages_for_docker_step(),
build_docker_images_step(edition=edition), build_docker_images_step(edition=edition),
...@@ -220,24 +221,7 @@ def lint_backend_step(edition): ...@@ -220,24 +221,7 @@ def lint_backend_step(edition):
], ],
} }
def build_storybook_step(edition, publish=False): def build_storybook_step(edition):
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',
},
}
return { return {
'name': 'build-storybook', 'name': 'build-storybook',
'image': build_image, 'image': build_image,
...@@ -245,8 +229,32 @@ def build_storybook_step(edition, publish=False): ...@@ -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 # Best to ensure that this step doesn't mess with what's getting built and packaged
'package', '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): def build_backend_step(edition, variants=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment