mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 16:00:19 -05:00
607deb31dc
Mainly leave shadow-cljs for build cljs stuff and use esbuild for bundle all js dependencies, completly avoiding all possible incompatibility issues between js libraries and google closure compiler.
37 lines
1.1 KiB
Bash
Executable file
37 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# NOTE: this script should be called from the parent directory to
|
|
# properly work.
|
|
|
|
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)};
|
|
export EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS;
|
|
export TS=$(date +%s);
|
|
|
|
# Some cljs reacts on this environment variable for define more
|
|
# performant code on macros (example: rumext)
|
|
export NODE_ENV=production;
|
|
|
|
yarn install || exit 1;
|
|
rm -rf resources/public;
|
|
rm -rf target/dist;
|
|
|
|
yarn run build:app --config-merge "{:release-version \"${CURRENT_HASH}-${TS}\"}" $EXTRA_PARAMS || exit 1
|
|
yarn run build:app:libs || 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;
|
|
|
|
if [ "$INCLUDE_STORYBOOK" = "yes" ]; then
|
|
# build storybook
|
|
yarn run build:storybook || exit 1;
|
|
rsync -avr storybook-static/ target/dist/storybook-static;
|
|
fi
|