Update fly.io deployment script with env variables
This commit is contained in:
@@ -26,5 +26,6 @@ dependency-reduced-pom.xml
|
||||
logs/
|
||||
.DS_Store
|
||||
.env
|
||||
.env-fly
|
||||
data/*
|
||||
!project/assembly.sbt
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user