Skip to content

Commit 4fe96f4

Browse files
Feature/GitHub actions (#2)
* actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * actionsを修正 * 微調整 * ADD README * fix: README
1 parent 83a1797 commit 4fe96f4

File tree

4 files changed

+131
-17
lines changed

4 files changed

+131
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Test with jOOQ and Docker
1+
name: Build and Test
22

33
on:
44
pull_request:

README.md renamed to README.en.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,25 @@
88
![Java 21](https://img.shields.io/badge/Java-21%2B-blue)
99
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-CC2233.svg)](https://opensource.org/licenses/Apache-2.0)
1010

11-
## 🔍 Overview / 概要
11+
## 🔍 Overview
1212

1313
This repository serves as a **Spring Batch Starter Kit**, specifically tailored for **Spring Boot 3** and **Spring Batch 5**. It streamlines batch job development by leveraging the **latest features** and ensuring full compatibility with Spring Boot 3.
1414
Whether you’re upgrading from **Spring Boot 2** or starting a new project, this starter kit enables you to **harness the enhanced capabilities** of Spring Batch with ease.
1515

16-
このリポジトリは、Spring Boot 3 と Spring Batch 5 の最新機能を活用して、バッチ処理開発を効率化するためのスターターキットです。動作する事が保証されたテンプレート上に業務ロジックを追加するだけで、簡単にバッチ処理を構築できます。Spring Boot 2 からの移行や新規プロジェクトにおいて、すぐに最新のバッチフレームワークを活用できます。
17-
18-
### 📝 Key Highlights / 主な特徴
16+
### 📝 Key Highlights
1917
- **Skeleton Batch Framework**: Quickly develop custom batch jobs with minimal setup.
2018
- **DB to CSV Batch**: Export data from MySQL to CSV files seamlessly, with runtime arguments for dynamic WHERE clauses and flexible output configurations.
2119
- **CSV to DB Batch**: Import CSV data into MySQL efficiently with bulk operations and error handling.
2220

23-
24-
- **スケルトンバッチ**: 業務ロジックを追加するだけでバッチを簡単に構築する事が可能です。
25-
- **DB to CSVバッチ**: MySQLデータをCSVファイルに簡単に出力できます。実行時引数を利用した動的なWHERE句や柔軟な出力設定に対応しています。
26-
- **CSV to DBバッチ**: CSVデータをMySQLに効率的に取り込みます。バルク処理機能を備えています。
27-
2821
### Reusability / 再利用性
2922

3023
This kit is highly adaptable. By simply updating the database connection settings and modifying the CSV column definitions to match your specific business needs, you can immediately start using it for your projects.
3124

32-
DB接続設定やCSVのカラム定義を業務仕様に合わせて変更するだけで、すぐにプロジェクトで利用できます。シンプルなテンプレートを基に、業務ロジックを追加するだけで、効率的に高機能なバッチ処理を構築できます。
33-
3425
---
3526

3627

3728

38-
## 💡 Key Features / 特徴
29+
## 💡 Key Features
3930

4031
### Batch Development Made Simple
4132
- **Spring Batch Framework**: Streamlined job and step management.
@@ -53,10 +44,11 @@ DB接続設定やCSVのカラム定義を業務仕様に合わせて変更する
5344
### Future-Proof Design
5445
- **Skeleton Batch Framework**: A template for creating new batch jobs.
5546
- **Pre-configured Docker Environment**: Quickly set up a local MySQL database.
47+
- **CI/CD**: Achieve Continuous Integration and Continuous Delivery with Github Actions.
5648

5749
---
5850

59-
## 🗂️ Project Structure / プロジェクト構成
51+
## 🗂️ Project Structure
6052
```text
6153
.
6254
├── gradlew
@@ -79,7 +71,7 @@ DB接続設定やCSVのカラム定義を業務仕様に合わせて変更する
7971
└── test
8072
```
8173

82-
## 🛠️ Getting Started / はじめに
74+
## 🛠️ Getting Started
8375

8476
### 1. Clone the repository
8577
```bash
@@ -123,7 +115,7 @@ java -jar build/libs/dbAndCsvBatch-*.jar --spring.batch.job.name=CSV_TO_DB --spr
123115
#### 🎉 **With this Spring Batch Starter Kit, you can focus on your business logic while the framework handles the heavy lifting.**
124116
**Happy coding!** 🚀
125117

126-
## 📄 License / ライセンス
118+
## 📄 License
127119

128120
This project is licensed under the **[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)**.
129121
Copyright © 2024 KINTO Technologies Corporation

README.ja.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
### 日本語用README (`README.ja.md`)
2+
3+
# Spring Batch 5 Starter
4+
5+
**コピペで即完成! Spring Batch 5** 🚀
6+
7+
[![GitHub stars](https://img.shields.io/github/stars/KTC-YoheiMiyashita/SpringBoot3BatchStarter?style=social)](https://github.com/KTC-YoheiMiyashita/SpringBoot3BatchStarter/stargazers)
8+
[![Build](https://github.com/kinto-technologies/SpringBoot3BatchStarter/actions/workflows/build.yml/badge.svg)](https://github.com/kinto-technologies/SpringBoot3BatchStarter/actions/workflows/build.yml)
9+
![Java 21](https://img.shields.io/badge/Java-21%2B-blue)
10+
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-CC2233.svg)](https://opensource.org/licenses/Apache-2.0)
11+
12+
## 🔍 Overview
13+
14+
このリポジトリは、**Spring Boot 3****Spring Batch 5** のために特化した**Spring Batchスターターキット**です。
15+
最新機能を活用し、Spring Boot 3との完全な互換性を持つことで、バッチジョブ開発を効率化します。
16+
**Spring Boot 2** からの移行や新規プロジェクトで、**Spring Batchの強化された機能**を簡単に活用できます。
17+
18+
### 📝 Key Highlights
19+
- **スケルトンバッチフレームワーク**: 最小限の設定でカスタムバッチジョブを簡単に開発できます。
20+
- **DB to CSV バッチ**: MySQLデータをCSVファイルにエクスポート。動的なWHERE句や柔軟な出力設定に対応しています。
21+
- **CSV to DB バッチ**: CSVデータをMySQLに効率的にインポートします。バルク処理とエラーハンドリング機能を備えています。
22+
23+
### 再利用性
24+
このキットは非常に適応性があります。データベース接続設定を更新し、CSVのカラム定義を業務要件に合わせて変更するだけで、すぐにプロジェクトに利用できます。
25+
26+
---
27+
28+
29+
30+
## 💡 特徴
31+
32+
### Batch Development Made Simple
33+
- **Spring Batch フレームワーク**: ジョブとステップの管理を効率化。
34+
- **JOOQ ORM**: SQLライクなクエリ記述とエンティティ生成機能。
35+
- **OpenCSV 統合**: CSVファイルの簡単な取り扱い。
36+
- **マルチデータベースサポート**:
37+
- H2 : バッチメタデータ管理にH2
38+
- MySQL : 業務データ処理にMySQL
39+
40+
### 柔軟性と最適化
41+
- **動的な設定**: 環境ごとの設定(ローカル/サーバー)をプロファイルで管理。
42+
- **カスタマイズ可能なバッチ**: 実行時の引数で複数のジョブを動的に実行。
43+
- **Google Java Format**: Spotlessを使用した自動コード整形。
44+
45+
### 将来に向けた設計
46+
- **スケルトンバッチフレームワーク**: 事前設定されたDocker環境。
47+
- **事前設定されたDocker環境**: ローカルのMySQLデータベースを迅速にセットアップ。
48+
- **CI/CD**: Github Actions で「継続的インテグレーションと継続的デリバリーを実現。
49+
50+
---
51+
52+
## 🗂️ プロジェクト概要
53+
```text
54+
.
55+
├── gradlew
56+
├── settings.gradle
57+
├── compose.yaml
58+
├── init-scripts
59+
│ ├── 1-create-table.sql
60+
│ └── 2-insert-data.sql
61+
├── dbAndCsvBatch
62+
│ ├── README.md
63+
│ ├── build.gradle
64+
│ └── src
65+
│ ├── main
66+
│ └── test
67+
└── skeletonBatch
68+
├── README.md
69+
├── build.gradle
70+
└── src
71+
├── main
72+
└── test
73+
```
74+
75+
## 🛠️ はじめに
76+
77+
### 1. リポジトリをクローンする
78+
```bash
79+
git clone https://github.com/kinto-technologies/SpringBoot3BatchStarter.git
80+
```
81+
82+
### 2. スケルトンバッチをビルドする
83+
```bash
84+
cd skeletonBatch
85+
../gradlew
86+
```
87+
88+
### 3. スケルトンバッチを実行する
89+
```bash
90+
java -jar build/libs/skeletonBatch-*.jar
91+
```
92+
93+
### 4. MySQLデータベースを設定する(Docker)
94+
```bash
95+
docker compose up -d
96+
```
97+
98+
### 5. DB と CSV バッチジョブをビルドする
99+
```bash
100+
cd ../dbAndCsvBatch
101+
../gradlew
102+
```
103+
104+
### 6. DB to CSV バッチを実行する
105+
```bash
106+
java -jar build/libs/dbAndCsvBatch-*.jar --spring.batch.job.name=DB_TO_CSV --spring.profiles.active=local
107+
```
108+
109+
### 7. CSV to DB バッチを実行する
110+
```bash
111+
java -jar build/libs/dbAndCsvBatch-*.jar --spring.batch.job.name=CSV_TO_DB --spring.profiles.active=local
112+
```
113+
114+
> **注意**: ステップ4を実行する前にDockerがインストールされていて、実行中であることを確認してください。
115+
116+
#### 🎉 このSpring Batchスターターキットを使えば、フレームワークが重い作業を引き受ける間に、あなたはビジネスロジックに集中できます。
117+
**楽しいコーディングを!** 🚀
118+
119+
## 📄 ライセンス
120+
121+
このプロジェクトは、**[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)** の下でライセンスされています。
122+
Copyright © 2024 KINTO Technologies Corporation

dbAndCsvBatch/src/test/java/com/example/batch/service/CsvToDbServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void setUp() throws IOException {
6666
"2024-12-07T09:46:07"
6767
});
6868
}
69-
log.info("Temporary CSV file content written successfully.");
69+
log.info("Temporary CSV file created at: {}", tempCsvFile.getAbsolutePath());
7070
}
7171

7272
@Test

0 commit comments

Comments
 (0)