Skip to content

Commit 721139f

Browse files
authored
Refactor ping mysql to a Makefile target (CodelyTV#129)
1 parent 4e29ab5 commit 721139f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Wait for the environment to get up
2020
run: |
21-
while ! docker exec codelytv-php_ddd_skeleton-mooc-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent &> /dev/null ; do
21+
while ! make ping-mysql &>/dev/null; do
2222
echo "Waiting for database connection..."
2323
sleep 2
2424
done

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build deps composer-install composer-update composer reload test run-tests start stop destroy doco rebuild start-local
1+
.PHONY: build deps composer-install composer-update composer reload test run-tests start stop destroy doco rebuild start-local ping-mysql
22

33
current-dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
44

@@ -55,4 +55,7 @@ stop-local:
5555
symfony server:stop --dir=apps/mooc/backend/public
5656
symfony server:stop --dir=apps/backoffice/frontend/public
5757
symfony server:stop --dir=apps/backoffice/backend/public
58+
59+
ping-mysql:
60+
@docker exec codelytv-php_ddd_skeleton-mooc-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent
5861

0 commit comments

Comments
 (0)