2021-03-31 01:32:57 -05:00
|
|
|
#!/usr/bin/env bash
|
2024-03-01 09:23:35 -05:00
|
|
|
# NOTE: this script should be called from the parent directory to
|
|
|
|
# properly work.
|
2021-03-31 01:32:57 -05:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2023-12-22 06:40:24 -05:00
|
|
|
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;
|
|
|
|
|
|
|
|
# Some cljs reacts on this environment variable for define more
|
|
|
|
# performant code on macros (example: rumext)
|
|
|
|
export NODE_ENV=production;
|
2021-03-31 01:32:57 -05:00
|
|
|
|
|
|
|
yarn install || exit 1;
|
2024-03-01 09:23:35 -05:00
|
|
|
rm -rf resources/public;
|
|
|
|
rm -rf target/dist;
|
2023-09-19 05:16:37 -05:00
|
|
|
|
2024-03-01 09:23:35 -05:00
|
|
|
clojure -M:dev:shadow-cljs release main --config-merge "{:release-version \"${CURRENT_HASH}\"}" $EXTRA_PARAMS || exit 1
|
2023-09-19 05:16:37 -05:00
|
|
|
|
2024-03-01 09:23:35 -05:00
|
|
|
yarn run compile || exit 1;
|
2024-03-27 05:08:59 -05:00
|
|
|
mkdir -p target/dist;
|
2024-03-01 09:23:35 -05:00
|
|
|
rsync -avr resources/public/ target/dist/
|
2021-03-31 01:32:57 -05:00
|
|
|
|
|
|
|
sed -i -re "s/\%version\%/$CURRENT_VERSION/g" ./target/dist/index.html;
|
2022-04-06 04:14:18 -05:00
|
|
|
sed -i -re "s/\%buildDate\%/$BUILD_DATE/g" ./target/dist/index.html;
|