Skip to content

Commit 565f69f

Browse files
authored
Refactor ping mysql to a Makefile target (#42)
1 parent 3db5fff commit 565f69f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/ci.yml

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

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

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PONY: all build test
1+
.PHONY: all build test ping-mysql
22

33
all: build
44

@@ -16,6 +16,9 @@ test:
1616

1717
run:
1818
@./gradlew :run
19+
20+
ping-mysql:
21+
@docker exec codelytv-java_ddd_skeleton-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent
1922

2023
# Start the app
2124
start-mooc_backend:

0 commit comments

Comments
 (0)