Skip to content

Commit d54283a

Browse files
authored
Merge pull request #1 from TeamDoubleO/KW-121/chore/project-init
[KW-121] chore: project init
2 parents 78f2a61 + e6da5e7 commit d54283a

41 files changed

Lines changed: 1087 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#빌드 캐시
2+
.gradle
3+
build
4+
!build/libs/*.jar
5+
out
6+
target
7+
8+
#IDE 설정
9+
*.iml
10+
.idea
11+
.vscode
12+
13+
#OS 임시 파일
14+
.DS_Store
15+
Thumbs.db
16+
17+
#Git 관련
18+
.git
19+
.gitignore
20+
21+
# 로그, 환경변수
22+
*.log
23+
.env
24+
*.secret

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/gradlew text eol=lf
2+
*.bat text eol=crlf
3+
*.jar binary
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: "♻️ refactor"
3+
about: 리팩토링 이슈 템플릿
4+
titles: "♻️ "
5+
labels: "♻️ refactor"
6+
assignees: ''
7+
8+
---
9+
10+
## 📌 Description
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: "⚙️ chore"
3+
about: CI/CD 및 설정 이슈 템플릿
4+
titles: "⚙️ "
5+
labels: "⚙️ chore"
6+
assignees: ''
7+
8+
---
9+
10+
## 📌 Description
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: "✨ feature"
3+
about: 기능 추가 이슈 템플릿
4+
titles: ""
5+
labels: "✨ feature"
6+
assignees: ''
7+
8+
---
9+
10+
## 📌 Description
11+

.github/ISSUE_TEMPLATE/🐛-fix.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: "🐛 fix"
3+
about: 버그 및 에러 이슈 템플릿
4+
titles: "🐛 "
5+
labels: "🐛 bug/error"
6+
assignees: ''
7+
8+
---
9+
10+
## 📌 Description
11+
12+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## 🔷 Jira Ticket ID
2+
3+
[KW-]
4+
5+
---
6+
## 📌 작업 내용 및 특이사항
7+
8+
-
9+
10+
---
11+
## 📚 참고사항
12+
13+
-
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Docker Push on PR Target
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
docker-build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout source
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Java
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: 21
21+
22+
- run: chmod +x ./gradlew
23+
24+
- name: Run tests
25+
run: ./gradlew test
26+
27+
- name: Build JAR
28+
run: ./gradlew build
29+
30+
- name: Docker login
31+
uses: docker/login-action@v3
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@v5
38+
with:
39+
context: .
40+
push: true
41+
tags: sunwoo11/keywe_log_service:latest
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Develop PR CI & Test
2+
on:
3+
pull_request:
4+
branches:
5+
- develop
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
env:
12+
DOCKER_IMAGE_NAME: sunwoo11/log-service
13+
DOCKER_TAG: latest
14+
15+
jobs:
16+
build-test:
17+
if: github.event_name == 'pull_request' && github.base_ref == 'develop'
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout source code
22+
uses: actions/checkout@v3
23+
24+
- name: Set up JDK 21
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: 'temurin'
28+
java-version: 21
29+
30+
- name: Cache Gradle packages
31+
uses: actions/cache@v3
32+
with:
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: ${{ runner.os }}-gradle
38+
39+
- name: Grant execute permission for gradlew
40+
run: chmod +x ./gradlew
41+
42+
- name: Run Spotless check
43+
run: ./gradlew spotlessCheck
44+
45+
- name: Run tests
46+
run: ./gradlew test

.github/workflows/pr_title.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Auto PR Title Prefix
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
update-title:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Extract issue key and update PR title
15+
uses: actions/github-script@v7
16+
with:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
script: |
19+
const pr = context.payload.pull_request;
20+
const branchName = pr.head.ref;
21+
22+
const match = branchName.match(/(KW-\d+)/);
23+
if (!match) {
24+
console.log("No KW-XX issue key found in branch name.");
25+
return;
26+
}
27+
28+
const issueKey = match[1];
29+
30+
const cleanTitle = pr.title
31+
.replace(/^\[KW-\d+\]\s*/, '')
32+
.replace(new RegExp(`^${issueKey}/`), '')
33+
34+
const newTitle = `[${issueKey}] ${cleanTitle}`;
35+
36+
if (newTitle !== pr.title) {
37+
await github.rest.pulls.update({
38+
owner: context.repo.owner,
39+
repo: context.repo.repo,
40+
pull_number: pr.number,
41+
title: newTitle
42+
});
43+
console.log("PR title updated to:", newTitle);
44+
} else {
45+
console.log("PR title already formatted correctly.");
46+
}

0 commit comments

Comments
 (0)