mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 16:51:55 +00:00
ci: error handle story book build fail (#52428)
Automatically fail Buildkite build step `:chromatic: Upload Storybook to Chromatic` if Chromatic storybook build fails. Previously, if the Chromatic deployment failed to build for some reason, the build would still succeed. Making the report unreliable This change adds a check to see if the `pnpm chromatic` exit status is non zero, and If so, the script will immediately exit with a failure, causing the Buildkite build to be marked as failed. context: https://sourcegraph.slack.com/archives/C04MYFW01NV/p1684969967117259 ## Test plan ci <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles -->
This commit is contained in:
parent
60d130de3b
commit
0004d6410a
@ -10,8 +10,16 @@ set -eu -o pipefail
|
||||
# - BUILDKITE_PULL_REQUEST
|
||||
# - RENDER_PREVIEW_GITHUB_TOKEN
|
||||
|
||||
exit_status=$?
|
||||
chromatic_publish_output=$(</dev/stdin)
|
||||
|
||||
if [ $exit_status -eq 0 ]; then
|
||||
echo "$chromatic_publish_output"
|
||||
else
|
||||
echo "$chromatic_publish_output"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$chromatic_publish_output"
|
||||
|
||||
# Chromatic preview url from Chromatic publish output (`-m 1` for getting first match)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user