🔧 Update script names and conditionally build storybook

This commit is contained in:
Andrey Antukh 2024-08-05 11:29:14 +02:00 committed by Belén Albeza
parent 2b2bc73564
commit 0f16f65d30
5 changed files with 31 additions and 29 deletions

View file

@ -4,6 +4,8 @@
set -ex
export INCLUDE_STORYBOOK=${BUILD_STORYBOOK:-no};
export CURRENT_VERSION=$1;
export BUILD_DATE=$(date -R);
export CURRENT_HASH=${CURRENT_HASH:-$(git rev-parse --short HEAD)};
@ -20,13 +22,16 @@ rm -rf target/dist;
clojure -M:dev:shadow-cljs release main --config-merge "{:release-version \"${CURRENT_HASH}-${TS}\"}" $EXTRA_PARAMS || exit 1
yarn run compile || exit 1;
yarn run build:app:assets || exit 1;
mkdir -p target/dist;
rsync -avr resources/public/ target/dist/
sed -i -re "s/\%version\%/$CURRENT_VERSION/g" ./target/dist/index.html;
sed -i -re "s/\%buildDate\%/$BUILD_DATE/g" ./target/dist/index.html;
# build storybook
yarn run storybook:build || exit 1;
rsync -avr storybook-static/ target/dist/storybook-static
if [ "$INCLUDE_STORYBOOK" = "yes"]; then
# build storybook
yarn run build:storybook || exit 1;
rsync -avr storybook-static/ target/dist/storybook-static;
fi