Skip to content

Commit fd5122a

Browse files
authored
Merge pull request #134 from depromeet/develop
deploy-22.08.25.1
2 parents 6a4f236 + 940aa2a commit fd5122a

File tree

152 files changed

+1483
-451
lines changed

Some content is hidden

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

152 files changed

+1483
-451
lines changed

.ebextensions-dev/00-makeFiles.config

-11
This file was deleted.
+11-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
files:
2-
"/sbin/appstart" :
2+
"/sbin/api_start" :
33
mode: "000755"
44
owner: webapp
55
group: webapp
66
content: |
7-
#!/usr/bin/env bash
8-
JAR_PATH=/var/app/current/application.jar
9-
107
# run app
11-
java -Duser.timezone="Asia/Seoul" -Dspring.profiles.active=real -jar $JAR_PATH
8+
kill `ps -ef | grep fairer-api | awk '{print $2}'`
9+
java -Duser.timezone="Asia/Seoul" -Dspring.profiles.active=real -jar /var/app/current/fairer-api.jar
10+
"/sbin/batch_start" :
11+
mode: "000755"
12+
owner: webapp
13+
group: webapp
14+
content: |
15+
# run app
16+
kill `ps -ef | grep fairer-batch | awk '{print $2}'`
17+
java -Duser.timezone="Asia/Seoul" -Dspring.profiles.active=real -jar /var/app/current/fairer-batch.jar

.github/workflows/dev-fairer-api.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7+
8+
name: dev-fairer-api
9+
10+
on:
11+
workflow_dispatch:
12+
push:
13+
branches: [ develop ]
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Set up JDK 11
24+
uses: actions/setup-java@v2
25+
with:
26+
java-version: '11'
27+
distribution: 'adopt'
28+
29+
- name: Login to Docker Hub
30+
uses: docker/login-action@v1
31+
with:
32+
username: ${{ secrets.DOCKERHUB_USERNAME }}
33+
password: ${{ secrets.DOCKERHUB_TOKEN }}
34+
35+
- name: Grant execute permission for gradlew
36+
run: chmod +x ./gradlew # gradle wrapper를 실행할 수 있도록 권한 부여
37+
shell: bash
38+
39+
- name: Set timezone to Seoul
40+
run: sudo timedatectl set-timezone Asia/Seoul
41+
shell: bash
42+
43+
- name: JIB Build with Gradle
44+
run: ./gradlew :fairer-api:jib # 프로젝트 빌드
45+
shell: bash
46+
47+
- name: Get current time
48+
uses: 1466587594/get-current-time@v2 # 빌드 완료 시간 가져오기
49+
id: current-time
50+
with:
51+
format: YYYY-MM-DD-HH-mm-ss
52+
utcOffset: "+09:00"
53+
54+
- name: Show Current Time
55+
run: echo "CurrentTime=${{steps.current-time.outputs.formattedTime}}" # 빌드 완료 시간 출력하기
56+
shell: bash
57+
58+
deploy:
59+
needs: build
60+
name: Deploy
61+
runs-on: [ self-hosted, label-development ]
62+
steps:
63+
- name: Docker run
64+
run: |
65+
sudo docker ps -q --filter "name=fairer-dev" | grep -q . && sudo docker stop "fairer-dev" && sudo docker rmi "fairerbe/fairer-dev-repo:latest"
66+
sudo docker run -d --name fairer-dev --rm -p 8080:8080 fairerbe/fairer-dev-repo:latest

.github/workflows/dev-fairer.yml .github/workflows/dev-fairer-batch.yml

+21-22
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
66
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
77

8-
name: dev-fairer
8+
name: dev-fairer-batch
99

1010
on:
1111
workflow_dispatch:
@@ -26,12 +26,22 @@ jobs:
2626
java-version: '11'
2727
distribution: 'adopt'
2828

29+
- name: Login to Docker Hub
30+
uses: docker/login-action@v1
31+
with:
32+
username: ${{ secrets.DOCKERHUB_USERNAME }}
33+
password: ${{ secrets.DOCKERHUB_TOKEN }}
34+
2935
- name: Grant execute permission for gradlew
3036
run: chmod +x ./gradlew # gradle wrapper를 실행할 수 있도록 권한 부여
3137
shell: bash
3238

33-
- name: Build with Gradle
34-
run: ./gradlew clean build # 프로젝트 빌드
39+
- name: Set timezone to Seoul
40+
run: sudo timedatectl set-timezone Asia/Seoul
41+
shell: bash
42+
43+
- name: JIB Build with Gradle
44+
run: ./gradlew :fairer-batch:jib # 프로젝트 빌드
3545
shell: bash
3646

3747
- name: Get current time
@@ -45,23 +55,12 @@ jobs:
4555
run: echo "CurrentTime=${{steps.current-time.outputs.formattedTime}}" # 빌드 완료 시간 출력하기
4656
shell: bash
4757

48-
# gradle build를 통해 만들어진 jar 파일 codedeploy에 배포하기 위한 zip 파일로 만듬
49-
- name: Generate deployment package
58+
deploy:
59+
needs: build
60+
name: Deploy
61+
runs-on: [ self-hosted, label-development ]
62+
steps:
63+
- name: Docker run
5064
run: |
51-
mkdir -p deploy
52-
cp build/libs/*.jar deploy/fairer-dev.jar
53-
cp deploy.sh deploy/deploy.sh
54-
cd deploy
55-
56-
- name: aws 세팅
57-
uses: aws-actions/configure-aws-credentials@v1
58-
with:
59-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
60-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
61-
aws-region: ap-northeast-2
62-
63-
- name: S3 업로드
64-
run: aws deploy push --application-name 2-Team-CodeDeploy --s3-location s3://depromeet11th/2team/fairer_dev/build.zip --source .
65-
66-
- name: code deploy
67-
run: aws deploy create-deployment --application-name 2-Team-CodeDeploy --deployment-config-name CodeDeployDefault.OneAtATime --deployment-group-name 2-Team-CodeDeploy-Group --s3-location bucket=depromeet11th,bundleType=zip,key=2team/fairer_dev/build.zip
65+
sudo docker ps -q --filter "name=fairer-batch-dev" | grep -q . && sudo docker stop "fairer-batch-dev" && sudo docker rmi "fairerbe/fairer-batch-dev:latest"
66+
sudo docker run -d --name fairer-batch-dev --rm -p 8081:8081 fairerbe/fairer-batch-dev:latest

.github/workflows/real-fairer.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ jobs:
3030
run: chmod +x ./gradlew # gradle wrapper를 실행할 수 있도록 권한 부여
3131
shell: bash
3232

33-
- name: Build with Gradle
34-
run: ./gradlew clean build # 프로젝트 빌드
33+
- name: Build API with Gradle
34+
run: ./gradlew :fairer-api:build # 프로젝트 빌드
35+
shell: bash
36+
37+
- name: Build Batch with Gradle
38+
run: ./gradlew :fairer-batch:build # 프로젝트 빌드
3539
shell: bash
3640

3741
- name: Get current time
@@ -49,7 +53,8 @@ jobs:
4953
- name: Generate deployment package
5054
run: |
5155
mkdir -p deploy
52-
cp build/libs/*.jar deploy/application.jar
56+
cp fairer-api/build/libs/*.jar deploy/fairer-api.jar
57+
cp fairer-batch/build/libs/*.jar deploy/fairer-batch.jar
5358
cp Procfile deploy/Procfile
5459
cp -r .ebextensions-real deploy/.ebextensions
5560
cp -r .platform deploy/.platform

Procfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
web: appstart
1+
api: api_start
2+
batch: batch_start

README.md

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# 🧹 fairer
2+
<p>
3+
<img src="https://img.shields.io/github/issues-pr-closed/depromeet/fairer-be?color=blueviolet"/>
4+
<img src="https://img.shields.io/github/issues/depromeet/fairer-be?color=inactive"/> <img src="https://img.shields.io/github/issues-closed/depromeet/fairer-be"/>
5+
<img src="https://img.shields.io/github/stars/depromeet/fairer-be"/>
6+
</p>
7+
8+
<img src="https://user-images.githubusercontent.com/77181984/175760346-a164f36f-3c12-41ab-9a06-2f86885baf9a.png" width="650"/><br/>
9+
집안일을 하는 모든 이들의 평화를 위한 집안일 관리, 분담 서비스 👨‍👧‍👧<br/>
10+
fairer의 백엔드 레포지토리 입니다.
11+
> Play 스토어 : https://play.google.com/store/apps/details?id=com.depromeet.housekeeper
12+
13+
<br/>
14+
15+
## 🎬 Preview
16+
<img src="https://user-images.githubusercontent.com/77181984/175762475-ac741a33-9a1b-414f-97d8-0f92abc45f1e.png" width="230"/> &nbsp;&nbsp; <img src="https://user-images.githubusercontent.com/77181984/175762490-add086a6-13c6-46ca-a309-f9813c009457.png" width="230"/>
17+
18+
<br/>
19+
20+
## 👨‍👩‍👧‍👧 BackEnd Developer
21+
22+
23+
24+
| <img src="https://user-images.githubusercontent.com/77181984/175761511-863c24d7-dae1-4539-9dad-d82b83a3c907.png" width="150"/> | <img src="https://user-images.githubusercontent.com/77181984/175761513-22e7b9f1-26b6-43c2-b117-359db6157e06.jpeg" width="150"/> | <img src="https://user-images.githubusercontent.com/77181984/175761514-2842fd4b-8a95-4f40-ad01-eb075e32fb85.png" width="150"/> | <img src="https://user-images.githubusercontent.com/77181984/175761515-5092022d-d4f1-4db4-8fcc-18f9479fda93.jpeg" width="150"/> |
25+
| :-----------------------------------: | :-----------------: | :----------------: |:----------------: |
26+
| [김승윤](https://github.com/dskym) | [신동빈](https://github.com/SDB016) | [김다슬](https://github.com/daseulll) | [곽다은](https://github.com/daeunkwak) |
27+
28+
<br/>
29+
30+
## **💻 Tech Stack**
31+
32+
- Skills
33+
34+
> Spring Boot, Data JPA(+Querydsl)
35+
>
36+
- Database
37+
38+
> Mysql, RDS
39+
>
40+
- 개발 환경
41+
42+
> AWS EC2
43+
>
44+
- 운영 환경
45+
46+
> Elastic Beanstalk
47+
>
48+
- CI/CD
49+
50+
> [Github Actions](https://github.com/depromeet/fairer-be/actions)
51+
>
52+
- 문서화
53+
54+
> [Swagger](http://ec2-13-125-232-180.ap-northeast-2.compute.amazonaws.com:8080/swagger-ui/index.html)
55+
>
56+
- ETC
57+
58+
> JWT, Oauth2(google)
59+
60+
> Spring Batch
61+
>
62+
63+
<br/>
64+
65+
## 📚 Architecture
66+
<img src="https://user-images.githubusercontent.com/77181984/175924599-312a74a4-c506-49b5-a937-3fd82706419f.PNG" width="750"/>
67+
68+
<br/>
69+
70+
## 🗂 Directory
71+
```
72+
📂 fairer
73+
📂 api
74+
📂 domain
75+
📂 dto
76+
📂 global
77+
├── 📂 config
78+
├── 📂 exception
79+
| ├── 📂 dto
80+
| └── 📂 handler
81+
├── 📂 resolver
82+
└── 📂 util
83+
📂 repository
84+
📂 service
85+
📂 vo
86+
- Application.java
87+
```
88+
89+
<br/>
90+
91+
## 📝ERD
92+
<img src="https://user-images.githubusercontent.com/77181984/176247477-e1c0277b-e4d1-4049-817c-16e08668976b.PNG" width="550"/>
93+
94+
<br/>
95+
96+
## 💻 Build & Run
97+
1. 빌드
98+
```
99+
$ ./gradlew build
100+
```
101+
2. 빌드된 파일 (*.jar) 실행
102+
```
103+
$ fairer-0.0.1-SNAPSHOT.jar
104+
$ java -jar fairer-0.0.1-SNAPSHOT.jar
105+
```
106+
107+
<br/>
108+
109+
110+
## 📢 Commit message
111+
112+
113+
`feat` : 새로운 기능에 대한 커밋
114+
115+
`fix` : 버그 수정에 대한 커밋
116+
117+
`refactor` : 새로운 기능 추가나 수정 없이 기존 코드 리팩토링
118+
119+
`docs` : 문서화에 대한 커밋
120+
121+
122+
<br/>
123+
124+
## 📞 Contact
125+
[![Facebook](https://img.shields.io/badge/facebook-1877f2?style=flat-square&logo=facebook&logoColor=white&link=https://www.facebook.com/fairer.official/)](https://www.facebook.com/fairer.official)
126+
[![instagram](https://img.shields.io/badge/instagram-E4405F?style=flat-square&logo=Instagram&logoColor=white&link=https://www.instagram.com/fairer.official/)](https://www.instagram.com/fairer.official/)

appspec.yml

-16
This file was deleted.

0 commit comments

Comments
 (0)