Files
explore/tools/scripts/dev.preset.sh
T
tom goriunovandGitHub 811ba0a437 Move generated assets into separate folder inside the public folder (#1930)
* add build-time ENV to explicitly enable Open Telemetry

* generate svg-sprite before next build

* move envs.js to assets folder

* move favicon bundle to assets folder

* move external configs to configs folder

* fix envs validator
2024-05-20 13:17:33 +02:00

32 lines
807 B
Bash
Executable File

#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: yarn dev:preset <preset_name>"
exit 1
fi
preset_name="$1"
config_file="./configs/envs/.env.${preset_name}"
secrets_file="./configs/envs/.env.secrets"
if [ ! -f "$config_file" ]; then
echo "Error: File '$config_file' not found."
exit 1
fi
# download assets for the running instance
dotenv \
-e $config_file \
-- bash -c './deploy/scripts/download_assets.sh ./public/assets/configs'
yarn svg:build-sprite
echo ""
# generate envs.js file and run the app
dotenv \
-v NEXT_PUBLIC_GIT_COMMIT_SHA=$(git rev-parse --short HEAD) \
-v NEXT_PUBLIC_GIT_TAG=$(git describe --tags --abbrev=0) \
-e $config_file \
-e $secrets_file \
-- bash -c './deploy/scripts/make_envs_script.sh && next dev -p $NEXT_PUBLIC_APP_PORT --turbo' |
pino-pretty