summaryrefslogtreecommitdiff
path: root/scripts/frontend/start_storybook.sh
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-30 18:11:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-30 18:11:31 +0000
commitc753fd0bf4a5cc09f69941daef0f6fe99d61f20e (patch)
tree9aee7f1af879446f226d7a67c149c817ace3f69f /scripts/frontend/start_storybook.sh
parenteaec42f9e37fe51f9c53fa7079639ec9f4c40efc (diff)
downloadgitlab-ce-c753fd0bf4a5cc09f69941daef0f6fe99d61f20e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/frontend/start_storybook.sh')
-rwxr-xr-xscripts/frontend/start_storybook.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/frontend/start_storybook.sh b/scripts/frontend/start_storybook.sh
new file mode 100755
index 00000000000..7ae0a21b15b
--- /dev/null
+++ b/scripts/frontend/start_storybook.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+bold=$(tput bold)
+normal=$(tput sgr0)
+
+echo -e "Storybook provides a mock server that allows creating stories for components that make HTTP requests."
+echo -e "${bold}Storybook will fail to start if it can’t find the fixtures used by the mock server.${normal}\n"
+read -rp "Would you like to generate/update the frontend fixtures used by the mock server (y/N)? " answer
+
+if [[ "$answer" =~ ^(Y|y)$ ]] ; then
+ bundle exec rake frontend:mock_server_fixtures
+fi
+
+if ! [[ -d storybook/node_modules ]] ; then
+ yarn storybook:install
+fi
+
+yarn --cwd ./storybook start