Files
threshold/scripts/uigen.sh
T

26 lines
550 B
Bash
Raw Normal View History

#!/bin/sh
set -e
2020-10-08 18:51:53 +01:00
if [ -z "$UI_CLONE_DIR" ]; then
echo "Must set UI_CLONE_DIR"; exit 1
fi
2020-09-28 17:15:28 +01:00
2020-10-08 18:51:53 +01:00
if [ -z "$UI_ASSETS_FILE" ]; then
echo "Must set UI_ASSETS_FILE"; exit 1
2020-09-28 17:15:28 +01:00
fi
(
2020-10-08 18:51:53 +01:00
cd "$UI_CLONE_DIR"
2020-09-28 17:15:28 +01:00
if ! docker-compose -f docker-compose-embedding.yml run build; then
yarn install && yarn build
2020-09-28 17:15:28 +01:00
fi
)
uidir="${UI_CLONE_DIR}/ui/admin/dist"
2020-09-28 17:15:28 +01:00
2020-10-08 18:51:53 +01:00
go-bindata -fs -o "$UI_ASSETS_FILE.tmp" -pkg ui -prefix "${uidir}" "${uidir}" "${uidir}/assets"
2020-09-28 17:15:28 +01:00
2020-10-08 18:51:53 +01:00
printf "// +build ui\n" > "$UI_ASSETS_FILE"
cat "$UI_ASSETS_FILE.tmp" >> "$UI_ASSETS_FILE"
rm "$UI_ASSETS_FILE.tmp"