-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add Loki CI step to
eui-pull-request-and-deploy
pipeline
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
storybook_url="https://eui.elastic.co/storybook" | ||
|
||
# If the branch is not a pull request, Buildkite passes "false" | ||
# https://buildkite.com/docs/pipelines/environment-variables#BUILDKITE_PULL_REQUEST | ||
if [[ "${BUILDKITE_PULL_REQUEST}" != "false" ]]; then | ||
echo "+++ Running visual regression tests on pull request #${BUILDKITE_PULL_REQUEST}" | ||
echo "https://github.com/elastic/eui/pull/${BUILDKITE_PULL_REQUEST}" | ||
storybook_url="https://eui.elastic.co/pr_${BUILDKITE_PULL_REQUEST}/storybook" | ||
elif [[ "${BUILDKITE_BRANCH}" == "main" ]]; then | ||
echo "+++ Running visual regression tests on main" | ||
else | ||
echo "+++ :x: Visual regression tests can only be run against \`main\` and open pull requests. Exiting" | ||
exit 1 | ||
fi | ||
|
||
docker run \ | ||
-i \ | ||
--rm \ | ||
--env GIT_COMMITTER_NAME=test \ | ||
--env GIT_COMMITTER_EMAIL=test \ | ||
--env HOME=/tmp \ | ||
--user="$(id -u):$(id -g)" \ | ||
--volume="$(pwd):/app" \ | ||
--workdir=/app \ | ||
"$DOCKER_BASE_IMAGE" \ | ||
bash -c "yarn && yarn --cwd packages/eui test-visual-regression --reactUri $storybook_url" |