Skip to content

Commit 55c196c

Browse files
refactoring
1 parent 01a223d commit 55c196c

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Wait for MySQL to initialize
3030
run: |
3131
timeout 60s bash -c '
32-
CONTAINER_ID=$(docker ps -qf "name=mysql")
32+
CONTAINER_ID=$(docker ps -qf "name=mysql-container")
3333
until docker exec $CONTAINER_ID mysqladmin ping -uroot -prootpassword --silent; do
3434
echo "Waiting for MySQL to be ready..."
3535
sleep 5
@@ -38,7 +38,7 @@ jobs:
3838
3939
- name: Verify MySQL Initialization
4040
run: |
41-
docker exec mysql mysql -uroot -prootpassword -e "SHOW TABLES;" sampledb || echo "No tables found"
41+
docker exec mysql-container mysql -uroot -prootpassword -e "SHOW TABLES;" sampledb || echo "No tables found"
4242
4343
- name: MySQL Container Logs
4444
if: failure()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ java -jar build/libs/skeletonBatch-*.jar
9494

9595
### 4. Initialize Database
9696
```bash
97-
docker compose up -d
97+
docker compose down && docker compose build && docker compose up -d
9898
```
9999

100100
### 5. Build Data Processing Jobs

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.9'
22
services:
33
mysql:
44
image: mysql:latest
5-
container_name: mysql
5+
container_name: mysql-container
66
ports:
77
- 3306:3306
88
environment:

dbAndCsvBatch/build.gradle

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@ plugins {
99
id("com.github.spotbugs") version "6.0.27"
1010
}
1111

12+
repositories {mavenCentral()}
13+
1214
group = 'com.example.batch'
1315
version = '0.0.1-SNAPSHOT'
1416
description = 'SpringBatchDbAndCsv'
17+
1518
java {
16-
sourceCompatibility = JavaVersion.VERSION_21
17-
targetCompatibility = JavaVersion.VERSION_21
19+
toolchain {
20+
languageVersion = JavaLanguageVersion.of(21)
21+
}
1822
}
1923

20-
repositories {
21-
mavenCentral()
24+
bootJar {
25+
archiveBaseName = 'batch-dbAndCsv'
26+
archiveVersion = '0.0.1'
2227
}
2328

2429
// https://docs.spring.io/spring-boot/appendix/dependency-versions/coordinates.html

skeletonBatch/build.gradle

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@ plugins {
99
id("com.github.spotbugs") version "6.0.27"
1010
}
1111

12+
repositories {mavenCentral()}
13+
1214
group = 'com.example.batch'
1315
version = '0.0.1-SNAPSHOT'
1416
description = 'SpringBatchSkeleton'
1517

1618
java {
17-
sourceCompatibility = JavaVersion.VERSION_21
18-
targetCompatibility = JavaVersion.VERSION_21
19+
toolchain {
20+
languageVersion = JavaLanguageVersion.of(21)
21+
}
1922
}
2023

21-
repositories {
22-
mavenCentral()
24+
bootJar {
25+
archiveBaseName = 'batch-skeleton'
26+
archiveVersion = '0.0.1'
2327
}
2428

2529
// https://docs.spring.io/spring-boot/appendix/dependency-versions/coordinates.html
@@ -51,10 +55,4 @@ spotbugs {
5155
ignoreFailures = true
5256
}
5357

54-
jar {
55-
archiveBaseName = 'batch-skeleton'
56-
archiveVersion = '0.0.1'
57-
enabled = true
58-
}
59-
6058
defaultTasks 'tasks', 'spotlessApply', 'clean', 'check', 'jacocoTestReport', 'spotbugsMain', 'projectReport', 'bootJar'

0 commit comments

Comments
 (0)