Skip to content

Commit 26e9f1f

Browse files
committed
Ensure that demo plugin is built and tested via common scripts
1 parent ea3b5b0 commit 26e9f1f

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

Diff for: build-demos.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
pushd dynamic-demo-plugin
6+
yarn install
7+
yarn run build
8+
popd

Diff for: build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ set -e
44

55
./build-backend.sh
66
./build-frontend.sh
7+
./build-demos.sh

Diff for: test-demos.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
pushd dynamic-demo-plugin
6+
7+
# Check for outdated yarn.lock file
8+
if [[ -n "$(git status --porcelain -- yarn.lock)" ]]; then
9+
echo "Outdated yarn.lock file, commit changes to fix!"
10+
git --no-pager diff
11+
exit 1
12+
fi
13+
14+
popd

Diff for: test-frontend.sh

+6-7
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,26 @@ ARTIFACT_DIR=${ARTIFACT_DIR:=/tmp/artifacts}
88

99
cd frontend
1010

11-
# Fail fast if generated artifacts are out of sync
12-
13-
if git status --short | grep 'yarn.lock' >/dev/null; then
14-
printf "\n\nOUTDATED yarn.lock (COMMIT IT TO FIX!!!!!)\n"
15-
git diff
11+
# Check for outdated yarn.lock file
12+
if [[ -n "$(git status --porcelain -- yarn.lock)" ]]; then
13+
echo "Outdated yarn.lock file, commit changes to fix!"
14+
git --no-pager diff
1615
exit 1
1716
fi
1817

1918
# Dynamic plugin SDK docs are generated as part of the build, check for changes
2019
GIT_STATUS="$(git status --short --untracked-files -- packages/console-dynamic-plugin-sdk/docs)"
2120
if [ -n "$GIT_STATUS" ]; then
2221
echo "dynamic plugin sdk docs are not up to date. Run 'yarn generate-plugin-sdk-docs' then commit changes."
23-
git diff
22+
git --no-pager diff
2423
exit 1
2524
fi
2625

2726
yarn i18n
2827
GIT_STATUS="$(git status --short --untracked-files -- public/locales packages/**/locales)"
2928
if [ -n "$GIT_STATUS" ]; then
3029
echo "i18n files are not up to date. Run 'yarn i18n' then commit changes."
31-
git diff
30+
git --no-pager diff
3231
exit 1
3332
fi
3433

Diff for: test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ set -e
44

55
./test-backend.sh
66
./test-frontend.sh
7+
./test-demos.sh

0 commit comments

Comments
 (0)