-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REFACTOR] 멀티 모듈 및 SQS를 활용한 API 서버와 푸시알림 서버 분리 #92
Changes from 35 commits
4190c57
7391292
a4ccbbb
0357a5e
5ccdc81
16cce32
17814d7
c9f8f82
d2e3f87
4daac0d
a863c51
bdd468d
9d4616f
2c1aaf6
4fbe1f9
5ad7fef
bc931fa
7295759
451908d
ab1c0bc
7a9dba5
55a71af
e9c78ed
0326a29
00abc93
b0c0f08
865d05d
f2495ea
60b1ea3
fca32ea
a0d1036
bd75121
95015cf
43dbd94
fc828fd
4c14870
549320d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,23 @@ | |
# 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: Umbba-Server CI | ||
name: Umbba API Server CI | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
paths: | ||
- umbba-api/** | ||
- umbba-domain/** | ||
- umbba-common/** | ||
- umbba-external/** | ||
pull_request: | ||
branches: [ "develop" ] | ||
paths: | ||
- umbba-api/** | ||
- umbba-domain/** | ||
- umbba-common/** | ||
- umbba-external/** | ||
|
||
permissions: | ||
contents: read | ||
|
@@ -41,7 +51,7 @@ jobs: | |
distribution: 'temurin' | ||
|
||
# 3) 환경변수 파일 생성 | ||
- name: make application.properties 파일 생성 | ||
- name: make application.yml 파일 생성 | ||
run: | | ||
## create application.yml | ||
cd ./src/main/resources | ||
|
@@ -55,11 +65,20 @@ jobs: | |
|
||
# application.yml 파일 확인 | ||
cat ./application.yml | ||
|
||
#################################### | ||
|
||
# FCM secret key 폴더 생성 | ||
mkdir ./firebase | ||
cd ./firebase | ||
|
||
aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요기도 umbba-api/로 해야할듯요 !! |
||
|
||
shell: bash | ||
|
||
# 이 워크플로우는 gradle build | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle # 실제 application build(-x 옵션을 통해 test는 제외) | ||
run: ./gradlew build -x test | ||
run: ./gradlew umbba-api:bootJar -x test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# 워크플로우의 이름 지정 | ||
name: Umbba Notification Server CD | ||
|
||
# 해당 workflow가 언제 실행될 것인지에 대한 트리거를 지정 | ||
on: | ||
push: | ||
branches: [ "develop" ] | ||
paths: | ||
- umbba-notification/** | ||
- umbba-domain/** | ||
- umbba-common/** | ||
- umbba-external/** | ||
pull_request: | ||
branches: [ "develop" ] | ||
paths: | ||
- umbba-notification/** | ||
- umbba-domain/** | ||
- umbba-common/** | ||
- umbba-external/** | ||
|
||
env: | ||
S3_BUCKET_NAME: umbba-storage | ||
|
||
jobs: | ||
build: | ||
name: Code deployment | ||
|
||
# 실행 환경 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
# 2) JDK 11버전 설치, 다른 JDK 버전을 사용하다면 수정 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ap-northeast-2 | ||
|
||
# 3) 환경변수 파일 생성 | ||
- name: make application.yml 파일 생성 | ||
run: | | ||
# application.yml 파일 생성 | ||
cd ./src/main/resources | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기두 ./ -> umbba-notification/ |
||
rm application.yaml | ||
|
||
touch ./application.yml | ||
|
||
# GitHub-Actions 에서 설정한 값을 application.yml 파일에 쓰기 | ||
echo "${{ secrets.UMBBA_SECRET }}" >> ./application.yml | ||
|
||
# 생성된 파일 확인 | ||
cat ./application.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 !! |
||
|
||
#################################### | ||
|
||
# FCM secret key 폴더 생성 | ||
mkdir ./firebase | ||
cd ./firebase | ||
Comment on lines
+62
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도! |
||
|
||
aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . | ||
|
||
shell: bash | ||
|
||
# 이 워크플로우는 gradle build | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle # 실제 application build(-x 옵션을 통해 test는 제외) | ||
run: ./gradlew umbba-notification:bootJar -x test | ||
|
||
# 디렉토리 생성 | ||
- name: Make Directory | ||
run: mkdir -p deploy | ||
|
||
# Jar 파일 복사 | ||
- name: Copy Jar | ||
run: cp ./umbba-notification/build/libs/*.jar ./deploy | ||
# run: cp -r src/main/* ./deploy | ||
|
||
# appspec.yml, script files 파일 복사 | ||
- name: Copy files | ||
run: cp ./scripts/umbba-notification/* ./deploy | ||
|
||
- name: Make zip file | ||
run: zip -r ./umbba-notification.zip ./deploy | ||
shell: bash | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | ||
aws-region: ap-northeast-2 | ||
|
||
- name: Upload to S3 | ||
run: aws s3 cp --region ap-northeast-2 ./umbba-notification.zip s3://$S3_BUCKET_NAME/ | ||
|
||
# Deploy | ||
- name: Deploy | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} | ||
run: | ||
aws deploy create-deployment | ||
--application-name umbba-server-codedeploy | ||
--deployment-group-name umbba-notification-server-codedeploy-group | ||
--file-exists-behavior OVERWRITE | ||
--s3-location bucket=umbba-storage,bundleType=zip,key=umbba-notification.zip | ||
--region ap-northeast-2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# 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 | ||
# 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: Umbba Notification Server CI | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
paths: | ||
- umbba-notification/** | ||
- umbba-domain/** | ||
- umbba-common/** | ||
- umbba-external/** | ||
pull_request: | ||
branches: [ "develop" ] | ||
paths: | ||
- umbba-notification/** | ||
- umbba-domain/** | ||
- umbba-common/** | ||
- umbba-external/** | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
# 2) JDK 11버전 설치, 다른 JDK 버전을 사용하다면 수정 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
# 3) 환경변수 파일 생성 | ||
- name: make application.yml 파일 생성 | ||
run: | | ||
## create application.yml | ||
cd ./src/main/resources | ||
rm application.yaml | ||
|
||
# application.yml 파일 생성 | ||
touch ./application.yml | ||
|
||
# GitHub-Actions 에서 설정한 값을 application.yml 파일에 쓰기 | ||
echo "${{ secrets.UMBBA_SECRET }}" >> ./application.yml | ||
|
||
# application.yml 파일 확인 | ||
cat ./application.yml | ||
|
||
#################################### | ||
|
||
# FCM secret key 폴더 생성 | ||
mkdir ./firebase | ||
cd ./firebase | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 폴더링 변경 부탁드려요 ~~ |
||
|
||
aws s3 cp --region ap-northeast-2 s3://${{ secrets.S3_BUCKET_NAME }}/json/umbba-fcm-firebase-adminsdk.json . | ||
|
||
shell: bash | ||
|
||
# 이 워크플로우는 gradle build | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle # 실제 application build(-x 옵션을 통해 test는 제외) | ||
run: ./gradlew umbba-notification:bootJar -x test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
폴더링 변경 부탁드려욥