Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ev.v2 into dev
  • Loading branch information
AYoungSn committed May 8, 2024
2 parents 26da25c + bd7c51f commit 803729d
Show file tree
Hide file tree
Showing 481 changed files with 11,613 additions and 1,675 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checkstyle-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 👮Checkstyle validation

on:
pull_request:
branches: [ main, dev ]
branches: [ main, dev , recruit-dev]

jobs:
checkstyle:
Expand Down
45 changes: 23 additions & 22 deletions .github/workflows/main-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,27 @@ jobs:
docker tag ${{ env.IMAGE_NAME }}:${{ env.VERSION_TAG }} ${{ env.IMAGE_NAME }}:latest
docker push ${{ env.IMAGE_NAME }}:latest
- name: Get Github Actions IP
id: ip
uses: haythem/public-ip@v1.3
- name: Create the configuration file
run: |
cat << EOF > config.json
{
"AutoScalingGroupName": "gg-main",
"DesiredConfiguration": {
"LaunchTemplate": {
"LaunchTemplateId": "${{ secrets.LAUNCH_TEMPLATE_ID }}",
"Version": "\$Latest"
}
},
"Preferences": {
"MinHealthyPercentage": 100,
"MaxHealthyPercentage": 110,
"InstanceWarmup": 300,
"ScaleInProtectedInstances": "Ignore",
"StandbyInstances": "Ignore"
}
}
EOF
cat config.json
- name: AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -67,23 +85,6 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECURITY_SECRET_KEY }}
aws-region: ap-northeast-2

- name: Add Github Actions IP to Security group
run: |
aws ec2 authorize-security-group-ingress --group-id ${{ secrets.AWS_MAIN_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
- name: executing docker-compose up on main server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.MAIN_SERVER_HOST }}
username: ${{ secrets.MAIN_SERVER_USERNAME }}
key: ${{ secrets.MAIN_SERVER_PEM }}
script: |
cd ./docker
docker-compose down tomcat
docker rmi ${{ env.IMAGE_NAME }}:latest
docker-compose up tomcat -d
docker-compose up prometheus -d
- name: Remove Github Actions IP From Security Group
- name: Trigger Instance Refresh
run: |
aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_MAIN_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
aws autoscaling start-instance-refresh --cli-input-json file://config.json
2 changes: 1 addition & 1 deletion .github/workflows/test-code-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 💻 Test code validation

on:
pull_request:
branches: [ main, dev ]
branches: [ main, dev, recruit-dev]

jobs:
test:
Expand Down
49 changes: 25 additions & 24 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,34 +58,35 @@ jobs:
docker build -t ${{ env.IMAGE_NAME }}:latest .
docker push ${{ env.IMAGE_NAME }}:latest
- name: Get Github Actions IP
id: ip
uses: haythem/public-ip@v1.3

- name: AWS Credentials
- name: Create the configuration file
run: |
cat << EOF > config.json
{
"AutoScalingGroupName": "gg-dev",
"DesiredConfiguration": {
"LaunchTemplate": {
"LaunchTemplateId": "${{ secrets.DEV_LAUNCH_TEMPLATE_ID }}",
"Version": "\$Latest"
}
},
"Preferences": {
"MinHealthyPercentage": 100,
"MaxHealthyPercentage": 110,
"InstanceWarmup": 300,
"ScaleInProtectedInstances": "Ignore",
"StandbyInstances": "Ignore"
}
}
EOF
cat config.json
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_TEST_MIGRATE_SECURITY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_MIGRATE_SECURITY_SECRET_KEY }}
aws-region: ap-northeast-2

- name: Add Github Actions IP to Security group
run: |
aws ec2 authorize-security-group-ingress --group-id ${{ secrets.AWS_TEST_MIGRATE_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
- name: executing docker-compose up on test server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_MIGRATE_SERVER_HOST }}
username: ${{ secrets.TEST_MIGRATE_SERVER_USERNAME }}
key: ${{ secrets.TEST_MIGRATE_SERVER_PEM }}
script: |
cd /home/ec2-user/docker
docker-compose down tomcat
docker rmi ${{ env.IMAGE_NAME }}:latest
docker-compose up tomcat -d
docker-compose up prometheus -d
- name: Remove Github Actions IP From Security Group
- name: Trigger Instance Refresh
run: |
aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_TEST_MIGRATE_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
aws autoscaling start-instance-refresh --cli-input-json file://config.json
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
**/application.yml
gg-pingpong-api/src/main/resources/application.yml
.DS_Store
python
/logs
**/logs
**/src/main/generated/


### STS ###
Expand All @@ -27,9 +28,11 @@ bin/
*.iws
*.iml
*.ipr
*.log
out/
!**/src/main/**/out/
!**/src/test/**/out/
**/generated

### NetBeans ###
/nbproject/private/
Expand All @@ -46,7 +49,9 @@ out/
pingping.pem

### logs ###
./logs/*
**/logs/*

### git commit message convention file ###
.gitmessage.txt

**/generated
128 changes: 103 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ https://42gg.kr/

- 4기: 2023.08.01 ~ 2023.09.21

- 5기 : 2023.11.01 ~ 2024.01.31

## ⚡️ 프로젝트 아키텍처
<img alt="systemArchitecture" src="https://github.com/42organization/42gg.server.dev.v2/assets/67796301/c51e8d73-d8f2-4f5e-935c-325ec263857e" >&nbsp;&nbsp;&nbsp;&nbsp;
![gg-5th-architecture](https://github.com/42organization/42gg.server.dev.v2/assets/33301153/f801e7b5-d579-467b-9ad0-2bfec506dcaa)



## ⚡️ 3기 진행 사항
## ⚡️ 팀소개
### 3기
<details>
<summary> 3기 진행 사항</summary>
<div markdown="1">

### ⚡️⚡ 로그인 연동 추가
- v1에서 지원하지 않던 카카오계정 연동 기능 추가(좌 : v1, 우: v2) </br></br>
Expand Down Expand Up @@ -77,30 +85,9 @@ https://42gg.kr/
<img width=80% alt="dockerPs" src="https://github.com/42organization/42gg.server.dev.v2/assets/67796301/7da03342-14ed-47c7-9183-a68ad663109c" >&nbsp;&nbsp;&nbsp;&nbsp;
</div>

## ⚡️ 4기 진행 사항
### ⚡️⚡ DB table 구조 변경
- 상점, 티어 등 서비스 확장을 위한 DB 재설계
<img width="1103" alt="ERD V3" src="https://github.com/8luerose/42GG_Server/assets/105616046/a1eb2c31-53cc-4c12-94ff-5ca51ec2d522">

### ⚡️⚡ 재화 시스템 추가
- 출석, 게임 승패에 연관해 재화 시스템 추가
<img width="400" alt="attendance" src="https://github.com/42organization/42gg.server.dev.v2/assets/95139402/caa564c8-cb1b-45eb-975c-9e685911e764">

### ⚡️⚡ 상점, 아이템 서비스 추가
- 유저 요구사항을 반영한 기능 확장
<img width="629" alt="스크린샷 2023-09-23 오후 11 48 01" src="https://github.com/8luerose/42GG_Server/assets/105616046/77ce958b-5901-4638-9833-ab27cc182e88">
<img width="689" alt="스크린샷 2023-09-23 오후 11 48 18" src="https://github.com/8luerose/42GG_Server/assets/105616046/f953cbc4-9d97-4485-b318-4fe73e3e3222">

### ⚡️⚡ 티어 시스템 추가
- 랭킹전 활성화를 위한 티어 시스템 추가
<img width="400" alt="tier" src="https://github.com/42organization/42gg.server.dev.v2/assets/95139402/342e0013-13e0-4482-84b5-4381df0498cf">

### ⚡️⚡ 관리자 페이지 구현
- 원활한 운영을 위한 관리자 기능 추가
<img width="400" alt="admin" src="https://github.com/42organization/42gg.server.dev.v2/assets/95139402/59756773-48f3-463a-91e4-6bb263aac2f5">
</div>
</details>

## ⚡️ 팀소개
### 3기
<table>
<thead>
<tr>
Expand Down Expand Up @@ -129,7 +116,37 @@ https://42gg.kr/

</table>



### 4기
<details>
<summary> 4기 진행 사항</summary>
<div markdown="1">

### ⚡️⚡ DB table 구조 변경
- 상점, 티어 등 서비스 확장을 위한 DB 재설계
<img width="1103" alt="ERD V3" src="https://github.com/8luerose/42GG_Server/assets/105616046/a1eb2c31-53cc-4c12-94ff-5ca51ec2d522">

### ⚡️⚡ 재화 시스템 추가
- 출석, 게임 승패에 연관해 재화 시스템 추가
<img width="400" alt="attendance" src="https://github.com/42organization/42gg.server.dev.v2/assets/95139402/caa564c8-cb1b-45eb-975c-9e685911e764">

### ⚡️⚡ 상점, 아이템 서비스 추가
- 유저 요구사항을 반영한 기능 확장
<img width="629" alt="스크린샷 2023-09-23 오후 11 48 01" src="https://github.com/8luerose/42GG_Server/assets/105616046/77ce958b-5901-4638-9833-ab27cc182e88">
<img width="689" alt="스크린샷 2023-09-23 오후 11 48 18" src="https://github.com/8luerose/42GG_Server/assets/105616046/f953cbc4-9d97-4485-b318-4fe73e3e3222">

### ⚡️⚡ 티어 시스템 추가
- 랭킹전 활성화를 위한 티어 시스템 추가
<img width="400" alt="tier" src="https://github.com/42organization/42gg.server.dev.v2/assets/95139402/342e0013-13e0-4482-84b5-4381df0498cf">

### ⚡️⚡ 관리자 페이지 구현
- 원활한 운영을 위한 관리자 기능 추가
<img width="400" alt="admin" src="https://github.com/42organization/42gg.server.dev.v2/assets/95139402/59756773-48f3-463a-91e4-6bb263aac2f5">

</div>
</details>

<table>
<thead>
<tr>
Expand Down Expand Up @@ -157,8 +174,66 @@ https://42gg.kr/

</table>

### 5기
<details>
<summary> 5기 진행 사항</summary>
<div markdown="1">

### ⚡️⚡ 토너먼트 개발
<img width="437" alt="5th-tournament" src="https://github.com/42organization/42gg.server.dev.v2/assets/33301153/edae9ab7-b871-4c33-9d2a-d571615b9a6f">

### ⚡️⚡ 테스트 커버리지 개선 (2024-03-19 기준)
### 전체 68% -> 74%
<img width="878" alt="5th-test-coverage-total" src="https://github.com/42organization/42gg.server.dev.v2/assets/33301153/a479b541-c93c-45bb-a75f-ecaa2332ab16">

### 단위 테스트 0% -> 30%
<img width="1312" alt="5th-test-coverage-unit" src="https://github.com/42organization/42gg.server.dev.v2/assets/33301153/1eeb1495-d500-4345-b1d2-ba1cfe4ec6c4">


### ⚡️⚡ 아키텍처 변경
### BEFORE
<img alt="systemArchitecture" src="https://github.com/42organization/42gg.server.dev.v2/assets/67796301/c51e8d73-d8f2-4f5e-935c-325ec263857e" >&nbsp;&nbsp;&nbsp;&nbsp;
### AFTER
![gg-5th-architecture](https://github.com/42organization/42gg.server.dev.v2/assets/33301153/f801e7b5-d579-467b-9ad0-2bfec506dcaa)

### ⚡️⚡ DB table 구조 변경
![image](https://github.com/42organization/42gg.server.dev.v2/assets/33301153/d4c68d74-590c-41db-9c47-0bdd4f249bc3)


</div>
</details>

<table>
<thead>
<tr>
<td align=center>🏓</td>
<td align=center>🏓</td>
<td align=center>🏓</td>
<td align=center>🏓</td>
<td align=center>🏓</td>
</tr>
</thead>
<tr>
<td align=center><a href="https://github.com/kokomong2">고승준 @kokomong2</a></td>
<td align=center><a href="https://github.com/Kimhan-nah">김한나 @Kimhan-nah</a></td>
<td align=center><a href="https://github.com/Newsujin">박수진 @Newsujin</a></td>
<td align=center><a href="https://github.com/SONGS4RI"> 이자훈 @SONGS4RI</a></td>
<td align=center><a href="https://github.com/middlefitting">정승철 @middlefitting</a></td>
</tr>
<tr>
<td align=center>토너먼트 개발, <br> 테스트 커버리지 개선</td>
<td align=center>팀장, 토너먼트 개발, <br> 테스트 커버리지 개선</td>
<td align=center>토너먼트 개발, <br> 테스트 커버리지 개선</td>
<td align=center>토너먼트 개발, <br> 테스트 커버리지 개선</td>
<td align=center>인프라 담당, <br> 테스트 커버리지 개선</td>
</tr>
</table>

## ⚡️ 필요 파일
<details>
<summary> application.yml </summary>
<div markdown="1">

다음과 같은 양식의 "application.yml"파일이 "src/main/resources/"경로에 필요합니다.
```
spring:
Expand Down Expand Up @@ -319,3 +394,6 @@ app:
refreshTokenExpiry: ""
```

</div>
</details>
20 changes: 20 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ subprojects {
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.redisson:redisson:3.17.3'

//devtools
implementation 'org.springframework.boot:spring-boot-devtools'

/* spring doc */
implementation 'org.springdoc:springdoc-openapi-ui:1.6.6'

Expand Down Expand Up @@ -88,6 +91,10 @@ subprojects {
testImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
testImplementation "org.testcontainers:testcontainers:1.19.3"
testImplementation "org.testcontainers:junit-jupiter:1.19.3"

// mapstruct 추가
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
}

//테스트 커버리지 측정도구
Expand Down Expand Up @@ -238,6 +245,19 @@ subprojects {
project(':gg-pingpong-api') {
bootJar { enabled = true }
jar { enabled = true }
dependencies {
implementation project(':gg-data')
implementation project(':gg-repo')
implementation project(':gg-admin-repo')
implementation project(':gg-utils')
implementation project(':gg-auth')
implementation project(':gg-recruit-api')
}
}

project(':gg-recruit-api') {
bootJar { enabled = false }
jar { enabled = true }
dependencies {
implementation project(':gg-data')
implementation project(':gg-repo')
Expand Down
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ flags:
- gg-data/src/main/java/gg/data
- gg-auth/src/main/java/gg/auth
- gg-utils/src/main/java/gg/utils
- gg-recruit-api/src/main/java/gg/recruit/api
integrationTest:
paths:
- gg-pingpong-api/src/main/java/gg/pingpong/api
Expand All @@ -26,3 +27,4 @@ flags:
- gg-data/src/main/java/gg/data
- gg-auth/src/main/java/gg/auth
- gg-utils/src/main/java/gg/utils
- gg-recruit-api/src/main/java/gg/recruit/api
Loading

0 comments on commit 803729d

Please sign in to comment.