Skip to content

Commit 5e99dfd

Browse files
authored
[DEPLOY] v2.0.0
기능 추가/변경 사항 - 소식지 기능 추가 - 신고 기능 추가 - 멘토 / 멘티 기능 추가 - 채팅 관련 기능 추가 - 비밀번호 정책 추가 - 지원학기 변경 리팩토링 사항 - test fixture 도입 - JWT 토큰 개선 - 인증 정보 개선 - 쿠키 정책 변경 - text 검색 정책 변경
2 parents 9781c5b + 645f620 commit 5e99dfd

File tree

520 files changed

+15806
-6505
lines changed

Some content is hidden

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

520 files changed

+15806
-6505
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @Gyuhyeok99 @nayonsoso @wibaek
1+
* @Gyuhyeok99 @nayonsoso @wibaek @whqtker @lsy1307
Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: "[STAGE] Build Gradle and Deploy"
1+
name: "[DEV] Build Gradle and Deploy"
22

33
on:
44
push:
5-
branches: [ "release" ]
5+
branches: [ "develop" ]
66
workflow_dispatch:
77

88
jobs:
@@ -38,38 +38,47 @@ jobs:
3838
- name: Copy jar file to remote
3939
uses: appleboy/scp-action@master
4040
with:
41-
host: ${{ secrets.STAGE_HOST }}
42-
username: ${{ secrets.STAGE_USERNAME }}
43-
key: ${{ secrets.STAGE_PRIVATE_KEY }}
41+
host: ${{ secrets.DEV_HOST }}
42+
username: ${{ secrets.DEV_USERNAME }}
43+
key: ${{ secrets.DEV_PRIVATE_KEY }}
4444
source: "./build/libs/*.jar"
45-
target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/"
45+
target: "/home/${{ secrets.DEV_USERNAME }}/solid-connection-dev/"
4646

4747
- name: Copy docker file to remote
4848
uses: appleboy/scp-action@master
4949
with:
50-
host: ${{ secrets.STAGE_HOST }}
51-
username: ${{ secrets.STAGE_USERNAME }}
52-
key: ${{ secrets.STAGE_PRIVATE_KEY }}
50+
host: ${{ secrets.DEV_HOST }}
51+
username: ${{ secrets.DEV_USERNAME }}
52+
key: ${{ secrets.DEV_PRIVATE_KEY }}
5353
source: "./Dockerfile"
54-
target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/"
54+
target: "/home/${{ secrets.DEV_USERNAME }}/solid-connection-dev/"
5555

5656
- name: Copy docker compose file to remote
5757
uses: appleboy/scp-action@master
5858
with:
59-
host: ${{ secrets.STAGE_HOST }}
60-
username: ${{ secrets.STAGE_USERNAME }}
61-
key: ${{ secrets.STAGE_PRIVATE_KEY }}
62-
source: "./docker-compose.stage.yml"
63-
target: "/home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage/"
59+
host: ${{ secrets.DEV_HOST }}
60+
username: ${{ secrets.DEV_USERNAME }}
61+
key: ${{ secrets.DEV_PRIVATE_KEY }}
62+
source: "./docker-compose.dev.yml"
63+
target: "/home/${{ secrets.DEV_USERNAME }}/solid-connection-dev/"
64+
65+
- name: Copy alloy config file to remote
66+
uses: appleboy/scp-action@master
67+
with:
68+
host: ${{ secrets.DEV_HOST }}
69+
username: ${{ secrets.DEV_USERNAME }}
70+
key: ${{ secrets.DEV_PRIVATE_KEY }}
71+
source: "./docs/infra-config/config.alloy"
72+
target: "/home/${{ secrets.DEV_USERNAME }}/solid-connection-dev/"
6473

6574
- name: Run docker compose
6675
uses: appleboy/ssh-action@master
6776
with:
68-
host: ${{ secrets.STAGE_HOST }}
69-
username: ${{ secrets.STAGE_USERNAME }}
70-
key: ${{ secrets.STAGE_PRIVATE_KEY }}
77+
host: ${{ secrets.DEV_HOST }}
78+
username: ${{ secrets.DEV_USERNAME }}
79+
key: ${{ secrets.DEV_PRIVATE_KEY }}
7180
script_stop: true
7281
script: |
73-
cd /home/${{ secrets.STAGE_USERNAME }}/solid-connect-stage
82+
cd /home/${{ secrets.DEV_USERNAME }}/solid-connection-dev
7483
docker compose down
75-
docker compose -f docker-compose.stage.yml up -d --build
84+
docker compose -f docker-compose.dev.yml up -d --build

.github/workflows/prod-cd.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,16 @@ jobs:
6161
key: ${{ secrets.PRIVATE_KEY }}
6262
source: "./docker-compose.prod.yml"
6363
target: "/home/${{ secrets.USERNAME }}/solid-connect-server/"
64-
64+
65+
- name: Copy alloy config file to remote
66+
uses: appleboy/scp-action@master
67+
with:
68+
host: ${{ secrets.HOST }}
69+
username: ${{ secrets.USERNAME }}
70+
key: ${{ secrets.PRIVATE_KEY }}
71+
source: "./docs/infra-config/config.alloy"
72+
target: "/home/${{ secrets.USERNAME }}/solid-connect-server/"
73+
6574
- name: Run docker compose
6675
uses: appleboy/ssh-action@master
6776
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ build/
44
!gradle/wrapper/gradle-wrapper.jar
55
!**/src/main/**/build/
66
!**/src/test/**/build/
7+
logs/
78

89
### STS ###
910
.apt_generated

README.md

-50 Bytes

개발 환경

  • Java 17
  • 개발 환경 docker compose 실행
    • docker compose -f docker-compose.local.yml up -d
    • ./local_compose_up.sh

컨벤션

⚠️ 주의 !
이 컨벤션은 2024년 7월 지원까지의 코드에 해당합니다.
이후의 규칙은 자유롭게 만들어가주세요.
  • 함수의 이름은 동사구로 통일한다.

  • 어노테이션이 여러개 달리는 경우, 더 핵심이 되는 것을 아래에 위치한다. (개인적으로 어노테이션이 많아지면 코드와 가장 가까운 것에 제일 먼저 눈이 가기 때문)

  • 클래스의 바디가 시작할 때 개행하고, 바디가 끝나고 나서 개행한다. (구글 컨벤션에 의해)

  • 클래스에 있는 함수의 이름은 구체적으로 작성한다.

    • 예를 들어, UniversityController 에 있는 학교 검색 함수의 이름은 search 가 아니라 searchUniversity로 한다.
  • 테스트 코드에서 예외 발생 e2e 테스트는 이름을 "~면_예외_응답을_반환한다"로 통일한다.

  • 테스트 코드에서 예외 발생하는 테스트는 이름을 "~면_예외가_발생한다"로 통일한다.

build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id 'java'
33
id 'org.springframework.boot' version '3.1.5'
44
id 'io.spring.dependency-management' version '1.1.4'
5+
id 'org.flywaydb.flyway' version '9.16.3'
56
}
67

78
group = 'com.example'
@@ -31,6 +32,7 @@ dependencies {
3132
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
3233
implementation 'org.flywaydb:flyway-core'
3334
implementation 'org.flywaydb:flyway-mysql'
35+
runtimeOnly 'com.h2database:h2'
3436

3537
// QueryDSL
3638
implementation 'io.github.openfeign.querydsl:querydsl-jpa:6.11'
@@ -58,10 +60,14 @@ dependencies {
5860
testImplementation 'org.testcontainers:testcontainers'
5961
testImplementation 'org.testcontainers:junit-jupiter'
6062
testImplementation 'org.testcontainers:mysql'
63+
testImplementation 'org.projectlombok:lombok'
64+
testAnnotationProcessor 'org.projectlombok:lombok'
65+
testImplementation 'org.awaitility:awaitility:4.2.0'
6166

6267
// Etc
6368
implementation 'org.hibernate.validator:hibernate-validator'
6469
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.782'
70+
implementation 'org.springframework.boot:spring-boot-starter-websocket'
6571
}
6672

6773
tasks.named('test', Test) {
@@ -72,3 +78,21 @@ tasks.named('test', Test) {
7278
sourceSets {
7379
main.java.srcDirs += ['build/generated/sources/annotationProcessor/java/main']
7480
}
81+
82+
// build 단계에서 flyway 검증
83+
flyway {
84+
url = 'jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1'
85+
user = 'sa'
86+
password = ''
87+
locations = ['filesystem:src/main/resources/db/migration']
88+
validateMigrationNaming = true
89+
ignoreMigrationPatterns = ['*:pending']
90+
}
91+
92+
tasks.named('build') {
93+
dependsOn 'flywayValidate'
94+
}
95+
96+
tasks.named('bootJar') {
97+
dependsOn 'flywayValidate'
98+
}
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,28 @@ services:
1919
- redis
2020
network_mode: host
2121

22-
solid-connection-stage:
22+
solid-connection-dev:
2323
build:
2424
context: .
2525
dockerfile: Dockerfile
26-
container_name: solid-connection-stage
26+
container_name: solid-connection-dev
2727
ports:
2828
- "8080:8080"
2929
environment:
30-
- SPRING_PROFILES_ACTIVE=stage
30+
- SPRING_PROFILES_ACTIVE=dev
31+
volumes:
32+
- ./logs:/var/log/spring
3133
depends_on:
3234
- redis
3335
network_mode: host
36+
37+
alloy:
38+
image: grafana/alloy:latest
39+
container_name: alloy
40+
ports:
41+
- "12345:12345"
42+
volumes:
43+
- ./logs:/var/log/spring
44+
- ./docs/config.alloy:/etc/alloy/config.alloy:ro
45+
environment:
46+
- ALLOY_ENV=dev

docker-compose.prod.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,18 @@ services:
2828
- SPRING_PROFILES_ACTIVE=prod
2929
- SPRING_DATA_REDIS_HOST=redis
3030
- SPRING_DATA_REDIS_PORT=6379
31+
volumes:
32+
- ./logs:/var/log/spring
3133
depends_on:
3234
- redis
35+
36+
alloy:
37+
image: grafana/alloy:latest
38+
container_name: alloy
39+
ports:
40+
- "12345:12345"
41+
volumes:
42+
- ./logs:/var/log/spring
43+
- ./docs/config.alloy:/etc/alloy/config.alloy:ro
44+
environment:
45+
- ALLOY_ENV=production

0 commit comments

Comments
 (0)