Files
penpot/frontend/scripts/build

48 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# NOTE: this script should be called from the parent directory to
# properly work.
export INCLUDE_STORYBOOK=${BUILD_STORYBOOK:-no};
export INCLUDE_WASM=${BUILD_WASM:-yes};
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;
echo "Current path:"
echo $PATH
set -ex
corepack enable;
corepack install || exit 1;
yarn install || exit 1;
rm -rf resources/public;
rm -rf target/dist;
mkdir -p resources/public;
mkdir -p target/dist;
yarn run build:app:main $EXTRA_PARAMS;
if [ "$INCLUDE_WASM" = "yes" ]; then
yarn run build:wasm || exit 1;
fi
yarn run build:app:libs || exit 1;
yarn run build:app:assets || exit 1;
rsync -avr resources/public/ target/dist/;
if [ "$INCLUDE_STORYBOOK" = "yes" ]; then
# build storybook
yarn run build:storybook || exit 1;
rsync -avr storybook-static/ target/dist/storybook-static;
fi