Skip to content

Commit f41a6a1

Browse files
fix action
1 parent aaf9b2b commit f41a6a1

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@ jobs:
3232

3333
- name: Wait for MySQL to be ready
3434
run: |
35-
echo "Waiting for MySQL to be ready..."
36-
for i in {1..10}; do
37-
if mysqladmin ping -h 127.0.0.1 --silent; then
38-
echo "MySQL is ready!"
39-
break
40-
fi
41-
echo "MySQL not ready yet. Retrying in 5 seconds..."
42-
sleep 5
35+
until mysqladmin ping -h 127.0.0.1 --silent; do
36+
echo "Waiting for MySQL to be ready..."
37+
sleep 2
4338
done
4439
4540
- name: Set up JDK 17
@@ -49,4 +44,13 @@ jobs:
4944
java-version: '17'
5045

5146
- name: Build with Gradle
52-
run: ./gradlew build
47+
run: ./gradlew build
48+
49+
- name: Run skeletonBatch
50+
run: ./gradlew skeletonBatch:bootRun
51+
52+
- name: Run dbAndCsvBatch to Export Data to CSV
53+
run: ./gradlew dbAndCsvBatch:bootRun --args="--spring.profiles.active=local --spring.batch.job.name=DB_TO_CSV"
54+
55+
- name: Run dbAndCsvBatch to Import Data from CSV
56+
run: ./gradlew dbAndCsvBatch:bootRun --args="--spring.profiles.active=local --spring.batch.job.name=CSV_TO_DB"

application-local.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ spring:
33
url: jdbc:mysql://localhost:3306/sampledb
44
username: sampleuser
55
password: samplepassword
6-
jpa:
7-
hibernate:
8-
ddl-auto: none
9-
show-sql: true
6+
driver-class-name: com.mysql.cj.jdbc.Driver
7+
batch:
8+
job:
9+
names: DB_TO_CSV

compose.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
version: "3.8"
2-
31
services:
42
mysql:
53
image: mysql:latest
6-
container_name: mysql-container
4+
container_name: mysql-container-dev
75
ports:
86
- "3306:3306"
97
environment:
@@ -18,4 +16,7 @@ services:
1816
interval: 10s
1917
timeout: 5s
2018
retries: 5
21-
restart: always
19+
restart: always
20+
networks:
21+
default:
22+
name: springboot3batchstarter_default

0 commit comments

Comments
 (0)