Skip to content

Commit

Permalink
better readiness check
Browse files Browse the repository at this point in the history
  • Loading branch information
croyfish committed Nov 12, 2024
1 parent a65ab6d commit add8062
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,25 @@ jobs:
docker exec ${{ job.services.mysql.id }} bash -c "echo 'innodb_buffer_pool_size=64M' >> /etc/mysql/conf.d/custom.cnf"
docker restart ${{ job.services.mysql.id }}
- name: Wait for Database Services
# - name: Wait for Database Services
# run: |
# sudo apt-get update
# sudo apt-get install -y postgresql-client mysql-client
# until pg_isready -h localhost -U postgres; do echo "Waiting for PostgreSQL..."; sleep 1; done
# #until mysqladmin ping --silent; do echo "Waiting for MySQL..."; sleep 1; done
# Re-check readiness
- name: Wait for Database Services after restart
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client mysql-client
until pg_isready -h localhost -U postgres; do echo "Waiting for PostgreSQL..."; sleep 1; done
#until mysqladmin ping --silent; do echo "Waiting for MySQL..."; sleep 1; done
until docker exec ${{ job.services.postgres.id }} pg_isready -U postgres; do
echo "Waiting for PostgreSQL to be ready after restart..."
sleep 2
done
# Uncomment if needed for MySQL
# until docker exec ${{ job.services.mysql.id }} mysqladmin ping --silent; do
# echo "Waiting for MySQL to be ready after restart..."
# sleep 2
# done
- name: Show Database Logs
run: |
Expand Down

0 comments on commit add8062

Please sign in to comment.