Skip to content

Commit

Permalink
Changed github workflow file to try migrations 5 times
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshD94 committed Nov 20, 2024
1 parent 1a62c98 commit dcd6d05
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ jobs:
sudo systemctl stop nginx
sudo systemctl restart nginx
docker stack deploy -c docker-compose.yml the-stack --with-registry-auth
sleep 30s
docker exec $(docker ps -q -f name=the-stack_web) flask db upgrade
sleep 60s
attempt=1
max_attempts=5
until docker exec $(docker ps -q -f name=the-stack_web) flask db upgrade || [ $attempt -eq $max_attempts ]
do
echo "Migration attempt $attempt failed. Retrying..."
sleep 15
attempt=$((attempt + 1))
done
if [ $attempt -eq $max_attempts ]; then
echo "Migration failed after $max_attempts attempts"
exit 1
fi
yes | docker system prune -a

0 comments on commit dcd6d05

Please sign in to comment.