Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4eb6c81
Feat: 배포용 CI/CD 파이프라인 구축
incrying Feb 8, 2025
708979b
Merge pull request #23 from UMC-MapMories/22-feat-배포용-cicd-파이프라인-구축
incrying Feb 8, 2025
3c9787f
Refactor: yml 파일 수정
incrying Feb 8, 2025
3a771ac
Merge pull request #24 from UMC-MapMories/22-feat-배포용-cicd-파이프라인-구축
incrying Feb 8, 2025
8b1a128
Refactor: yml 파일 수정
incrying Feb 8, 2025
19d5a54
Merge pull request #25 from UMC-MapMories/22-feat-배포용-cicd-파이프라인-구축
incrying Feb 8, 2025
a9f52d2
Refactor: yml 파일 최종 수정
incrying Feb 8, 2025
f89f5ad
Merge pull request #26 from UMC-MapMories/22-feat-배포용-cicd-파이프라인-구축
incrying Feb 8, 2025
4ef56ab
Refactor: 배포 오류 관련 환경 설정 수정
incrying Feb 8, 2025
a5501cf
Merge pull request #27 from UMC-MapMories/22-feat-배포용-cicd-파이프라인-구축
incrying Feb 8, 2025
925b02e
Bug: 빌드 관련 오류 수정
incrying Feb 8, 2025
bf18eb7
Merge pull request #28 from UMC-MapMories/22-feat-배포용-cicd-파이프라인-구축
incrying Feb 8, 2025
a462097
Bug: 빌드 관련 오류 수정
incrying Feb 8, 2025
691fc05
Merge pull request #29 from UMC-MapMories/22-feat-배포용-cicd-파이프라인-구축
incrying Feb 8, 2025
1423718
Refactor: 환경 설정 파일 숮어
incrying Feb 8, 2025
ec60a5a
Merge branch 'develop' of github.com:UMC-MapMories/BE into develop
incrying Feb 8, 2025
0fa553f
Bug: 환경 변수 오류 수정
incrying Feb 8, 2025
039868c
Bug: 환경 변수 오류 수정
incrying Feb 8, 2025
215db49
Bug: 환경 변수 수정
incrying Feb 8, 2025
d55c20b
Bug: 환경 파일 삭제
incrying Feb 8, 2025
2a583a8
Bug: 환경 파일 재추가
incrying Feb 8, 2025
7298a4c
Bug: 환경파일 들여쓰기 수정
incrying Feb 8, 2025
b59081c
Bug: 환경파일명 수정
incrying Feb 8, 2025
4b759cb
Bug: 환경 설정 추가
incrying Feb 8, 2025
c3c1ea5
Bug: 환경설정 파일 오타 수정
incrying Feb 8, 2025
036dd04
Bug: 환경설정 파일 오타 수정
incrying Feb 8, 2025
168122f
Bug: 환경설정 파일 수정
incrying Feb 8, 2025
2d1a6f1
Bug: 환경설정 파일 수정
incrying Feb 8, 2025
193fa68
Bug: 환경설정 파일 수정
incrying Feb 8, 2025
321257d
Merge main into develop and resolve conflicts
incrying Feb 9, 2025
8faf40f
Fix: 환경설정 수정
incrying Feb 9, 2025
3827cce
Fix: 환경설정 수정
incrying Feb 9, 2025
37af419
Fix: 환경설정 수정
incrying Feb 9, 2025
669b46e
Fix: 환경설정 수정
incrying Feb 9, 2025
5b9ee88
Fix: 환경설정 수정
incrying Feb 9, 2025
7e8dccf
Fix: diary 나라 속성 추가
incrying Feb 10, 2025
86ec332
Refactor: 보안 정보 삭제
incrying Feb 10, 2025
5c6db1a
Refactor: 환경 설정 수정
incrying Feb 10, 2025
088f637
Refactor: 환경 설정 수정
incrying Feb 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
71 changes: 71 additions & 0 deletions .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI/CD Pipeline

on:
push:
branches: [ develop ] # develop 브랜치에 push가 일어날 때 실행

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3 # 저장소 코드 체크아웃

- name: Set up JDK 17 # Java 개발 킷 설정
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Grant execute permission for gradlew # gradlew 실행 권한 부여
run: chmod +x gradlew

- name: Create application.yml from Secrets # GitHub Secrets에서 application.yml 생성
run: |
echo "$APPLICATION_YML" > application.yml
env:
APPLICATION_YML: ${{ secrets.APPLICATION_YML }} # GitHub Secrets에서 가져오기

- name: Build with Gradle # Gradle을 사용하여 프로젝트 빌드
uses: gradle/gradle-build-action@v2
with:
arguments: build

- name: Upload build artifact # 빌드된 아티팩트 업로드
uses: actions/upload-artifact@v4
with:
name: mapmoriesServer
path: build/libs/*.jar

deploy:
needs: build # build 작업이 성공적으로 완료된 후 실행
runs-on: ubuntu-latest

steps:
- name: Download build artifact # 이전 단계에서 업로드한 아티팩트 다운로드
uses: actions/download-artifact@v4
with:
name: mapmoriesServer
path: build/libs/

- name: Deploy to EC2 # EC2에 배포
env:
EC2_SSH_KEY: ${{ secrets.EC2_SSH_KEY }}
EC2_USERNAME: ${{ secrets.EC2_USERNAME }}
EC2_HOST: ${{ secrets.EC2_HOST }} # GitHub Secrets에서 가져오기
run: |
echo "$EC2_SSH_KEY" > private_key.pem
chmod 600 private_key.pem

# JAR 파일 전송
jar_file=$(find build/libs -name '*.jar' ! -name '*plain.jar' | head -n 1)
scp -i private_key.pem -o StrictHostKeyChecking=no "$jar_file" $EC2_USERNAME@$EC2_HOST:/home/$EC2_USERNAME/umc7thServer.jar

# 애플리케이션 재시작
ssh -i private_key.pem -o StrictHostKeyChecking=no $EC2_USERNAME@$EC2_HOST "
pgrep java | xargs -r kill -15
sleep 10
nohup java -jar /home/$EC2_USERNAME/umc7thServer.jar --spring.config.location=/home/$EC2_USERNAME/application.yml > app.log 2>&1 &
"

rm -f private_key.pem # 민감한 정보 삭제
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

tasks.test {
testLogging {
showExceptions = true
exceptionFormat "full"
showStackTraces true
}
}
3 changes: 0 additions & 3 deletions demo/.gitattributes

This file was deleted.

38 changes: 0 additions & 38 deletions demo/.gitignore

This file was deleted.

42 changes: 0 additions & 42 deletions demo/build.gradle

This file was deleted.

Binary file removed demo/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 0 additions & 7 deletions demo/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Loading
Loading