-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from s2hoon/develop
Develop
- Loading branch information
Showing
88 changed files
with
2,136 additions
and
1,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Java CI with Gradle | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
|
||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 19 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '19' | ||
distribution: 'temurin' | ||
## gradle caching | ||
- name: Gradle Caching | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
## create application-dev.properties | ||
- name: make application-dev.properties | ||
if: contains(github.ref, 'develop') | ||
run: | | ||
cd ./src/main/resources | ||
touch ./application-dev.properties | ||
echo "${{ secrets.PROPERTIES_DEV }}" > ./application-dev.properties | ||
shell: bash | ||
|
||
## create application-prod.properties | ||
- name: make application-prod.properties | ||
if: contains(github.ref, 'main') # branch가 main 일 때, 나머지는 위와 동일 | ||
run: | | ||
cd ./src/main/resources | ||
touch ./application-prod.properties | ||
echo "${{ secrets.PROPERTIES_PROD }}" > ./application-prod.properties | ||
shell: bash | ||
|
||
## gradle build | ||
- name: Build with Gradle | ||
run: ./gradlew build -x test | ||
|
||
## docker build & push to production | ||
- name: Docker build & push to prod | ||
if: contains(github.ref, 'main') | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -f Dockerfile-prod -t ${{ secrets.DOCKER_USERNAME }}/dub-prod . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/dub-prod | ||
## docker build & push to develop | ||
- name: Docker build & push to dev | ||
if: contains(github.ref, 'develop') | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -f Dockerfile-dev -t ${{ secrets.DOCKER_USERNAME }}/dub-dev . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/dub-dev | ||
## deploy to production | ||
- name: Deploy to prod | ||
uses: appleboy/ssh-action@master | ||
id: deploy-prod | ||
if: contains(github.ref, 'main') | ||
with: | ||
host: ${{ secrets.HOST_PROD }} | ||
username: ubuntu | ||
key: ${{ secrets.SSH_KEY }} | ||
envs: GITHUB_SHA | ||
script: | | ||
sudo docker stop dub | ||
sudo docker rm dub | ||
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/dub-prod | ||
sudo docker run -d -p 8080:8080 --name dub ${{ secrets.DOCKER_USERNAME }}/dub-prod | ||
sudo docker image prune -f | ||
## deploy to develop | ||
- name: Deploy to dev | ||
uses: appleboy/ssh-action@master | ||
id: deploy-dev | ||
if: contains(github.ref, 'develop') | ||
with: | ||
host: ${{ secrets.HOST_DEV }} | ||
username: ec2-user | ||
key: ${{ secrets.SSH_KEY }} | ||
port: 22 | ||
#key: ${{ secrets.PRIVATE_KEY }} | ||
script: | | ||
sudo docker stop dub-dev | ||
sudo docker rm -fv dub-dev | ||
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/dub-dev | ||
sudo docker run -d -p 8080:8080 ${{ secrets.DOCKER_USERNAME }}/dub-dev | ||
sudo docker image prune -f | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## Dockerfile-dev | ||
FROM openjdk:19-alpine | ||
EXPOSE 8080 | ||
ARG JAR_FILE=/build/libs/dub-0.0.1-SNAPSHOT.jar | ||
COPY ${JAR_FILE} app.jar | ||
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=dev","/app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## Dockerfile-prod | ||
FROM openjdk:19-alpine | ||
EXPOSE 8080 | ||
ARG JAR_FILE=/build/libs/dub-0.0.1-SNAPSHOT.jar | ||
COPY ${JAR_FILE} app.jar | ||
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=prod","/app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,61 @@ | ||
--- | ||
|
||
|
||
# dub_club_wanted_BE | ||
동아리 버전 원티드 | ||
|
||
## dub | ||
동아리 홍보와, 동아리 지원을 할수있는 플랫폼 | ||
|
||
|
||
--- | ||
|
||
# 핵심기능 | ||
|
||
#### 1. 회원 가입 | ||
|
||
```일반 회원과 동아리 회원으로 나누어 가입이 가능합니다.``` | ||
|
||
#### 2. 동아리 등록 | ||
|
||
```동아리 회원은 동아리의 프로필 이미지, 태그, 소개글 등을 등록할 수 있습니다.``` | ||
|
||
#### 3. 동아리 공고 및 지원서 양식 등록 | ||
|
||
```동아리 회원은 동아리 내에서 공고를 올릴 수 있으며, 지원자들에게 지원서 양식을 제공할 수 있습니다.``` | ||
|
||
#### 4. 태그별 동아리 조회 | ||
|
||
```사용자는 태그별로 동아리를 검색하고 조회할 수 있습니다.``` | ||
|
||
#### 5. 동아리 지원서 다운로드 및 제출 | ||
|
||
```일반 회원은 동아리의 지원서 양식을 다운로드하여 작성한 후, 해당 동아리에 제출할 수 있습니다.``` | ||
|
||
#### 6. 동아리 회원별 지원자 조회 | ||
|
||
```동아리 회원은 자신의 동아리에 지원한 회원들을 조회할 수 있습니다.``` | ||
|
||
#### 7. 합격/불합격 통보 보내기 | ||
|
||
```동아리 회원은 지원자들에게 합격 또는 불합격 통보를 보낼 수 있습니다.``` | ||
|
||
--- | ||
|
||
# API 엔드포인트 목록 및 사용법 | ||
|
||
--- | ||
|
||
# CI/CD Flow | ||
|
||
![CIcd](https://github.com/s2hoon/dub_club_wanted_BE/assets/82464990/120399f7-7d09-4996-a8ac-631c4024a4fe) | ||
|
||
1. main branch 에 Push 또는 Merge | ||
2. Github 에 작성해둔 workflow file 로 Github Actions 수행 | ||
3. build, docker image build, docker image push 수행 | ||
4. EC2 인스턴스에서 docker image pull 후, run | ||
|
||
--- | ||
|
||
# ERD | ||
|
||
![erd](https://github.com/s2hoon/dub_club_wanted_BE/assets/82464990/d333d553-4d3a-45b5-a492-7f9ee254873e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,57 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.0.4' | ||
id 'io.spring.dependency-management' version '1.1.0' | ||
id 'java' | ||
id 'org.springframework.boot' version '3.0.4' | ||
id 'io.spring.dependency-management' version '1.1.0' | ||
} | ||
|
||
group = 'com.likelion' | ||
version = '0.0.1-SNAPSHOT' | ||
sourceCompatibility = '19' | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'mysql:mysql-connector-java:8.0.26' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
compileOnly 'org.projectlombok:lombok' | ||
developmentOnly 'org.springframework.boot:spring-boot-devtools' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
// jwt | ||
implementation 'io.jsonwebtoken:jjwt-api:0.11.5' | ||
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5' | ||
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5' | ||
implementation 'commons-io:commons-io:2.6' | ||
|
||
|
||
//swagger | ||
implementation 'io.springfox:springfox-boot-starter:3.0.0' | ||
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '3.0.0' | ||
|
||
// json 요청 | ||
implementation group: 'org.json', name: 'json', version: '20210307' | ||
// spring | ||
implementation 'org.springframework:spring-web' | ||
// spring boot | ||
developmentOnly 'org.springframework.boot:spring-boot-devtools' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
// mysql | ||
implementation 'mysql:mysql-connector-java:8.0.26' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
// lombok | ||
compileOnly 'org.projectlombok:lombok' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
// jwt | ||
implementation 'io.jsonwebtoken:jjwt-api:0.11.5' | ||
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5' | ||
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5' | ||
implementation 'commons-io:commons-io:2.6' | ||
|
||
// s3 | ||
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' | ||
// test | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
|
||
//thymeleaf | ||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:3.0.1' | ||
|
||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
useJUnitPlatform() | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...om/likelion/dub/common/BaseException.java → ...elion/dub/baseResponse/BaseException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.