chmura-zajecia-gitea-heroku/deploy.sh

34 lines
784 B
Bash
Raw Normal View History

2025-01-07 20:06:44 +01:00
#!/bin/bash
# App name
APP_NAME=s464951-gitea
WEB_URL=$(heroku create --stack container --region eu $APP_NAME --json | jq -r '.web_url')
echo $WEB_URL
# Add Heroku Postgres add-on
heroku addons:create heroku-postgresql:essential-0 --app $APP_NAME
2025-01-07 20:23:38 +01:00
while true; do
ADDON_STATUS=$(heroku addons:info heroku-postgresql --app $APP_NAME | grep 'State:' | awk '{print $2}')
echo "Postgres add-on state: $ADDON_STATUS"
if [ "$ADDON_STATUS" == "created" ]; then
echo "Heroku Postgres add-on is ready!"
break
fi
echo "Waiting for Postgres add-on to be ready..."
sleep 5
done
echo $DATABASE_URL
2025-01-07 20:06:44 +01:00
# Push to Heroku
heroku git:remote --app $APP_NAME
git add .
git commit -m "Deploy to Heroku"
git push heroku main
# Open the app in the browser
heroku open --app $APP_NAME