Skip to content

Commit

Permalink
Merge pull request #147 from Team-HMH/develop
Browse files Browse the repository at this point in the history
deploy - prod 서버 구축을 위한 main 브랜치 merge
  • Loading branch information
kseysh authored May 29, 2024
2 parents 878db68 + 7269436 commit 21b79dd
Show file tree
Hide file tree
Showing 179 changed files with 3,008 additions and 1,518 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🚀 APPLICATION-DEPLOY!
name: 🎉DEV-SERVER-DEPLOY🎉

on:
push:
Expand All @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
codedeploy-application-name: [ hmh-codedeploy-app ]
deployment-group-name: [ hmh-app-deploy-group ]
deployment-group-name: [ hmh-dev-deploy-group ]
s3-bucket: [ hmh-server-bucket ]

steps:
Expand All @@ -30,7 +30,7 @@ jobs:
shell: bash

- name: copy yml file
run: echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml
run: echo "${{ secrets.APPLICATION_DEV_YML }}" > ./src/main/resources/application.yml

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -49,12 +49,12 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}

- name: 🚀 s3 upload
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://${{matrix.s3-bucket}}/deploy/$GITHUB_SHA.zip
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://${{matrix.s3-bucket}}/dev/deploy/$GITHUB_SHA.zip

- name: ☀️ CodeDeploy~!
run: aws deploy create-deployment
--application-name ${{matrix.codedeploy-application-name}}
--deployment-group-name ${{matrix.deployment-group-name}}
--s3-location bucket=${{matrix.s3-bucket}},bundleType=zip,key=deploy/$GITHUB_SHA.zip
--s3-location bucket=${{matrix.s3-bucket}},bundleType=zip,key=dev/deploy/$GITHUB_SHA.zip
--file-exists-behavior OVERWRITE
--region ap-northeast-2
60 changes: 60 additions & 0 deletions .github/workflows/hmh-cd-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 🎉PROD-SERVER-DEPLOY🎉

on:
push:
branches: [ 'main' ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
codedeploy-application-name: [ hmh-codedeploy-app ]
deployment-group-name: [ hmh-prod-deploy-group ]
s3-bucket: [ hmh-server-bucket ]

steps:
- name: checkout
uses: actions/checkout@v3

- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'

- name: mkdir resources folder
run: |
mkdir ./src/main/resources
touch ./src/main/resources/application.yml
shell: bash

- name: copy yml file
run: echo "${{ secrets.APPLICATION_PROD_YML }}" > ./src/main/resources/application.yml

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: 🐈 Gradle Build
run: ./gradlew clean build

- name: 📂 Make zip file
run: zip -r ./$GITHUB_SHA.zip .

- name: 🪣 S3 upload
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: 🚀 s3 upload
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://${{matrix.s3-bucket}}/prod/deploy/$GITHUB_SHA.zip # 수정 고려

- name: ☀️ CodeDeploy~!
run: aws deploy create-deployment
--application-name ${{matrix.codedeploy-application-name}}
--deployment-group-name ${{matrix.deployment-group-name}}
--s3-location bucket=${{matrix.s3-bucket}},bundleType=zip,key=prod/deploy/$GITHUB_SHA.zip
--file-exists-behavior OVERWRITE
--region ap-northeast-2
8 changes: 4 additions & 4 deletions .github/workflows/hmh-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: 🏭 APPLICATION-BUILD!
on:
pull_request:
branches: [ "develop" ]
#push:
#branches: [ "develop" ]
push:
branches: [ "develop" ]

permissions:
contents: read
Expand All @@ -28,7 +28,7 @@ jobs:
mkdir ./src/main/resources
touch ./src/main/resources/application.yml
echo "${{ secrets.APPLICATION_YML }}" >> ./src/main/resources/application.yml
echo "${{ secrets.APPLICATION_DEV_YML }}" >> ./src/main/resources/application.yml
cat ./src/main/resources/application.yml
shell: bash
Expand All @@ -39,4 +39,4 @@ jobs:
- name: Build with Gradle
run: |
./gradlew build -x test
./gradlew clean build
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ application-local.yml
application-prod.yml

### Test ###
/src/test/
data.sql

# End of https://www.gitignore.io/api/java,macos,gradle,intellij
51 changes: 11 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,88 +2,59 @@
> 33th DO SOPT APPJAM :: HMH (하면함) <br>
> 프로젝트 기간 : 2023.12.17 ~ ing<br>
> <br>
당신의 소중한 시간을 위한 디지털 디톡스<br/>
<br>
스마트폰 중독 탈출, 너도 하면 함
<br>

![HMH](https://github.com/Team-HMH/HMH-Server/assets/69035864/b0c5045e-44a7-4616-b267-316120043558)

<br>
## 📌 Tech Stacks


- **Language** : Java (jdk-17)
- **Web application Framework** : Spring boot (3.2.1), Spring Data JPA
- **DataBase** : MySql (8.1.0)
- **DataBase** : MySql (8.1.0), Redis
- **Cloud/Infra** : Aws EC2, RDS, code deploy
- **web server** : Tomcat
- **Collaborative Tool** : Github
- **web server** : Tomcat, Nginx
- **Collaborative Tool** : Github, Slack, Notion
- **Version Control** : Git

<br/>

## 🖤 Developers




| 임주민 | 김승환 |
| :-----------------------------------------------------: | :------------------------------------------------------------: |
| <img width="300" alt="image" src="https://github.com/Team-HMH/HMH-Server/assets/76610340/ea57f67f-adcb-4abc-a198-7b962e61a6bc"> | <img width="300" alt="image" src="https://github.com/SOPT-33-iOS-Team-1/SOPKATHON_33-Server/assets/86935274/b1308faa-06cb-4818-878e-aeb8e17ac14c"> |
| [jumining](https://github.com/jumining) | [kseysh](https://github.com/kseysh) |

<br/>

## 🙋🏻‍♀️ 역할 분담


<div markdown="1">

- `주민🐹` & `승환🤖`

| 기능명 | 담당자 | 완료 여부 |
| --------------- | ----------- | --------- |
| 프로젝트 세팅 | 승환🤖 | 완료 |
| EC2 세팅 | 주민🐹 | 완료 |
| RDS 세팅 | 주민🐹 | 완료 |
| CI/CD 세팅 | 승환🤖 | 완료 |
| README 작성 | 승환🤖 | 완료 |
| DB 설계 | 주민🐹 승환🤖 | 완료 |
| API 명세서 작성 | 주민🐹 승환🤖 | 완료 |
| API 개발 | 주민🐹 승환🤖 | 진행중 |

</div>

<br/>

## ✅ Convention



### 🚀Convention

- [💻 협업 컨벤션](https://msmmx.notion.site/6fa22000670d4cf783559f7808c01d1a?pvs=4) <br>
- [💻 협업 컨벤션](https://hmhteam.notion.site/6fa22000670d4cf783559f7808c01d1a?pvs=4) <br>

### 🚀 Branch Strategy

- [💻 브랜치 전략](https://msmmx.notion.site/9d8065b238c543b890ceeb9912966dd0?pvs=4)
- [💻 브랜치 전략](https://hmhteam.notion.site/9d8065b238c543b890ceeb9912966dd0?pvs=4)

<br/>

## 💾 ERD

![image](https://github.com/Team-HMH/HMH-Server/assets/69035864/899d87a4-9262-47c4-9fc0-dc820a7f7189)



![image](https://github.com/Team-HMH/HMH-Server/assets/69035864/f4b95b3d-6507-4d33-be41-8a4847bc076f)

<br>

<br>

## ⚙️ Architecture

<img width="700" src="https://github.com/Team-HMH/HMH-Server/assets/76610340/825d260e-5a2e-494e-8abe-7299604b0bed">



![architecture](https://github.com/Team-HMH/HMH-Server/assets/69035864/e0eefac1-d8be-4a08-a3de-6e9786557042)


<br>
Expand Down
13 changes: 10 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ repositories {

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'

// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-validation'

// JPA & DataBase
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'com.mysql:mysql-connector-j'

// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'

// JWT
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
Expand All @@ -46,6 +46,13 @@ dependencies {

// Open Feign
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.1.0'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'

// Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}

tasks.named('test') {
Expand Down
Empty file added src/HMH-Server.iml
Empty file.
15 changes: 0 additions & 15 deletions src/main/java/sopt/org/HMH/HealthCheckApiController.java

This file was deleted.

This file was deleted.

43 changes: 0 additions & 43 deletions src/main/java/sopt/org/HMH/domain/app/domain/App.java

This file was deleted.

This file was deleted.

Loading

0 comments on commit 21b79dd

Please sign in to comment.