-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat: 모놀리틱 구조에서 멀티 모듈 구조로 전환 #116
Changes from 28 commits
3bcee48
4d393ea
4b19f0d
9008e6d
9515dad
c1ae34a
e7f10ec
cab6774
befe8cd
074a37c
eae4d1c
a6e3341
9572aba
a59c8a8
43b808a
4d2ab31
d7726c0
e6ad641
3826d7e
5f4507d
695ee79
95e968b
c0f7daf
d48ef04
ed53979
a91371c
86dc067
a60edad
f51c13a
772829a
48c07c6
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: NumberOne-Backend-JIB-BUILD-DEPLOY | |
# event trigger | ||
on: | ||
push: | ||
branches: [ "main", "dev", "dev-check" ] | ||
branches: [ "dev", "dev-check" ] | ||
|
||
permissions: write-all | ||
|
||
|
@@ -33,6 +33,39 @@ jobs: | |
- name: 🐧 Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
|
||
- name: get Current Time | ||
run: echo "CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV | ||
|
||
- name: 🔔 Send Slack Message when deploy started | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: custom | ||
custom_payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"title": "대피로 백엔드 배포를 시작합니다. 👻", | ||
"pretext": "Daepiro backend is deploying...", | ||
"fields": [ | ||
{ | ||
"title": "Author 💻", | ||
"value": "${{ github.actor }}", | ||
"short": true | ||
}, | ||
{ | ||
"title": "Deploy time 🕚", | ||
"value": "${{ env.CURRENT_TIME }}", | ||
"short": true | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
if: always() | ||
|
||
- name: 🔑 Login to Docker Hub | ||
uses: docker/[email protected] | ||
with: | ||
|
@@ -41,27 +74,30 @@ jobs: | |
|
||
- name: 🐧 create application.yml | ||
run: | | ||
mkdir -p ./src/main/resources | ||
cd ./src/main/resources | ||
mkdir -p ./daepiro-api/src/main/resources | ||
cd ./daepiro-api/src/main/resources | ||
touch ./application.yml | ||
echo "${{ secrets.PROPERTIES_PROD }}" | base64 --decode > ./application.yml | ||
ls -la | ||
shell: bash | ||
|
||
- name: 🐧 create service-account.json | ||
run: | | ||
cd ./src/main/resources | ||
cd ./daepiro-api/src/main/resources | ||
touch ./service-account.json | ||
echo "${{ secrets.FCM }}" | base64 --decode > ./service-account.json | ||
ls -la | ||
shell: bash | ||
|
||
- name: Build with jib | ||
run: | | ||
./gradlew jib -x test \ | ||
./gradlew :daepiro-api:jib -x test \ | ||
-Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \ | ||
-Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \ | ||
-Djib.to.image="${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest" | ||
env: | ||
EC2_PUBLIC_IP: ${{ secrets.EC2_PUBLIC_IP }} | ||
JMX_PORT: ${{ secrets.JMX_PORT }} | ||
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. main 메서드가 api모듈에 있기 때문에 api모듈 경로에서 빌드를 해주는거군요! |
||
|
||
- name: Get current time | ||
uses: 1466587594/get-current-time@v2 | ||
|
@@ -94,7 +130,7 @@ jobs: | |
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
fields: repo, message, commit, author, action, eventName, ref, workflow, pullRequest | ||
fields: repo, message, commit, author, workflow | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
if: always() |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
plugins { | ||
id 'com.google.cloud.tools.jib' version '3.4.0' | ||
} | ||
|
||
dependencies { | ||
implementation project(':daepiro-core') | ||
implementation project(':daepiro-common') | ||
implementation project(':daepiro-redis') | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
|
||
// swagger | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' | ||
|
||
// jpa | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
|
||
annotationProcessor 'org.projectlombok:lombok' | ||
|
||
compileOnly 'org.projectlombok:lombok' | ||
|
||
runtimeOnly 'com.h2database:h2' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
|
||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-redis' | ||
|
||
implementation 'io.jsonwebtoken:jjwt:0.9.1' | ||
implementation 'com.sun.xml.bind:jaxb-impl:4.0.1' | ||
implementation 'com.sun.xml.bind:jaxb-core:4.0.1' | ||
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' | ||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' | ||
|
||
// cloud | ||
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' | ||
|
||
// aop | ||
implementation 'org.springframework.boot:spring-boot-starter-aop' | ||
|
||
// fcm | ||
implementation 'com.google.firebase:firebase-admin:9.1.1' | ||
|
||
implementation 'com.squareup.okhttp3:okhttp:4.9.1' | ||
implementation 'org.jsoup:jsoup:1.14.2' | ||
implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
|
||
def serverIP = System.getenv("EC2_PUBLIC_IP") | ||
def jmxPort = System.getenv("JMX_PORT") | ||
|
||
jib { | ||
from { | ||
image = "openjdk:17" | ||
} | ||
to { | ||
image = "versatile0010/numberone" | ||
tags = ["latest"] | ||
} | ||
container { | ||
mainClass = 'com.numberone.backend.BackendApplication' | ||
creationTime = "USE_CURRENT_TIMESTAMP" | ||
jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/heap-dumps/heapdump.hprof"] | ||
ports = ['8080'] | ||
} | ||
} | ||
|
||
tasks.bootJar { | ||
enabled = true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,10 @@ | |
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.web.servlet.ServletComponentScan; | ||
|
||
@SpringBootApplication | ||
@ServletComponentScan | ||
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. ServletComponentScan 어노테이션이 어디에 쓰이는건가용? 구글링해봤는데 저희 프로젝트에서는 쓰이는 곳을 잘 못찾겠네요! |
||
public class BackendApplication { | ||
public static void main(String[] args) { | ||
SpringApplication.run(BackendApplication.class, args); | ||
|
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.
👍