bogui/scripts/publish.sh

19 lines
832 B
Bash
Raw Normal View History

2023-01-08 03:46:34 +01:00
#!/bin/bash
set -e
2023-01-08 23:27:07 +01:00
OPENAI_SECRET_KEY=$1
[[ ! $OPENAI_SECRET_KEY ]] && echo "Please pass a valid OpenAI token API key" && exit 1
2023-01-08 03:46:34 +01:00
flutter clean && flutter pub get
2023-01-09 01:22:13 +01:00
if [[ $2 == "html" ]]; then
2023-01-08 23:27:07 +01:00
rm -rf /home/poka/dev/bogui/build/web && flutter build web --web-renderer html --dart-define=OPENAPI_SECRET_KEY=${OPENAI_SECRET_KEY}
2023-11-20 11:18:12 +01:00
ssh -p 10422 poka@192.168.1.69 'rm -rf /home/poka/bogui-html && mkdir /home/poka/bogui-html'
rs /home/poka/dev/bogui/build/web poka@192.168.1.69:/home/poka/bogui-html/ 10422
2023-01-08 03:46:34 +01:00
else
2023-01-08 23:27:07 +01:00
rm -rf /home/poka/dev/bogui/build/web && flutter build web --web-renderer canvaskit --dart-define=OPENAPI_SECRET_KEY=${OPENAI_SECRET_KEY}
2023-11-20 11:18:12 +01:00
ssh -p 10422 poka@192.168.1.69 'rm -rf /home/poka/bogui && mkdir /home/poka/bogui'
rs /home/poka/dev/bogui/build/web poka@192.168.1.69:/home/poka/bogui/ 10422
2023-01-08 03:46:34 +01:00
fi