From 35f7f7b50a56ab146fb6d20415d86a3d51792301 Mon Sep 17 00:00:00 2001 From: Arve Knudsen Date: Thu, 16 Jul 2020 09:25:07 +0200 Subject: [PATCH] Drone: Rename publish-storybook to build-storybook (#26360) Signed-off-by: Arve Knudsen --- .drone.yml | 2 +- scripts/lib.star | 37 ++++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.drone.yml b/.drone.yml index 765275d0bdd..d1280883b86 100644 --- a/.drone.yml +++ b/.drone.yml @@ -146,7 +146,7 @@ steps: depends_on: - end-to-end-tests-server -- name: publish-storybook +- name: build-storybook image: grafana/build-container:1.2.21 commands: - rm -rf $(yarn cache dir) && cp -r yarn-cache $(yarn cache dir) diff --git a/scripts/lib.star b/scripts/lib.star index ba3843ca96d..13319dcc248 100644 --- a/scripts/lib.star +++ b/scripts/lib.star @@ -208,23 +208,7 @@ def pipelines(kind, name, edition): './e2e/run-suite', ], }, - { - 'name': 'publish-storybook', - 'image': build_image, - 'depends_on': [ - # Best to ensure that this step doesn't mess with what's getting built and packaged - 'package', - ], - 'commands': [ - restore_yarn_cache, - 'yarn storybook:build', - # TODO: Enable the following for non-forked PRs - # - echo $GCP_GRAFANA_UPLOAD_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/latest - # - gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/$CIRCLE_TAG - ], - }, + build_storybook_step(edition), { 'name': 'build-docs-website', # Use latest revision here, since we want to catch if it breaks @@ -414,3 +398,22 @@ def lint_backend_step(edition): cmd, ], } + +def build_storybook_step(edition): + return { + 'name': 'build-storybook', + 'image': build_image, + 'depends_on': [ + # Best to ensure that this step doesn't mess with what's getting built and packaged + 'package', + ], + 'commands': [ + restore_yarn_cache, + 'yarn storybook:build', + # TODO: Enable the following for OSS master builds + # - echo $GCP_GRAFANA_UPLOAD_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/latest + # - gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/$CIRCLE_TAG + ], + }