Skip to content

Commit

Permalink
Ensure that demo plugin is built and tested via common scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechszocs committed Jun 30, 2022
1 parent ea3b5b0 commit 26e9f1f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
8 changes: 8 additions & 0 deletions build-demos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

pushd dynamic-demo-plugin
yarn install
yarn run build
popd
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ set -e

./build-backend.sh
./build-frontend.sh
./build-demos.sh
14 changes: 14 additions & 0 deletions test-demos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

pushd dynamic-demo-plugin

# Check for outdated yarn.lock file
if [[ -n "$(git status --porcelain -- yarn.lock)" ]]; then
echo "Outdated yarn.lock file, commit changes to fix!"
git --no-pager diff
exit 1
fi

popd
13 changes: 6 additions & 7 deletions test-frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,26 @@ ARTIFACT_DIR=${ARTIFACT_DIR:=/tmp/artifacts}

cd frontend

# Fail fast if generated artifacts are out of sync

if git status --short | grep 'yarn.lock' >/dev/null; then
printf "\n\nOUTDATED yarn.lock (COMMIT IT TO FIX!!!!!)\n"
git diff
# Check for outdated yarn.lock file
if [[ -n "$(git status --porcelain -- yarn.lock)" ]]; then
echo "Outdated yarn.lock file, commit changes to fix!"
git --no-pager diff
exit 1
fi

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

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

Expand Down
1 change: 1 addition & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ set -e

./test-backend.sh
./test-frontend.sh
./test-demos.sh

0 comments on commit 26e9f1f

Please sign in to comment.