Update fly.io deployment script with env variables

This commit is contained in:
Guntis Smaukstelis
2024-01-21 22:30:23 +02:00
parent 99fb82c3fb
commit 80a192a401
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -1,11 +1,25 @@
#!/bin/bash
# build web files
cd web
npm run build
cd ..
# Check and set secrets
if [ -s .env-fly ]; then
while read line; do
echo "Setting secrets: $line"
fly secrets set "$line"
done < .env-fly
else
echo ".env-fly file is missing or empty, skipping setting secrets"
exit 1
fi
# Test, build and deply
if sbt test; then
sbt assembly && fly deploy
else
echo "Tests failed, skipping deploy!"
exit 1
fi