Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
小滋润 committed Nov 9, 2024
1 parent c20140f commit d89799a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/common-test-and-update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,29 @@ jobs:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Start mysql
run: |
docker-compose -f docker-compose.yaml up -d leap-ledger-mysql
- name: Wait for MySQL to be ready
run: |
# Set the maximum retry count and interval (e.g., 30 retries, 5 seconds each)
max_retries=30
retries=0
until docker exec leap-ledger-mysql mysqladmin -u root -p"$MYSQL_ROOT_PASSWORD" ping --silent; do
if [ $retries -ge $max_retries ]; then
echo "MySQL failed to start after $max_retries retries!"
exit 1
fi
retries=$((retries + 1))
echo "Waiting for MySQL to be ready... Retry $retries/$max_retries"
sleep 5
done
echo "MySQL is ready!"
- name: Start server
run: |
docker-compose -f docker-compose.yaml up -d leap-ledger-mysql && docker-compose -f docker-compose.yaml up -d
docker-compose -f docker-compose.yaml up -d
- name: Wait for 60 seconds
run: sleep 60
Expand Down

0 comments on commit d89799a

Please sign in to comment.