Skip to content

Commit

Permalink
�Feat: 각 모듈의 gradle 설정에서 필요한 부분 외에는 제거 (#122)
Browse files Browse the repository at this point in the history
* Feat(#121): gradle clean and removed unused files

* Feat(#121): make directory for service-account file

* Feat(#121): versioning to 0.0.2
  • Loading branch information
versatile0010 authored Feb 28, 2024
1 parent 7051523 commit a2c3eb5
Show file tree
Hide file tree
Showing 17 changed files with 114 additions and 317 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# github repository Actions 페이지에 나타낼 이름
name: NumberOne-Backend-CICD
name: NumberOne-Backend-CICD (fade-out)

# event trigger
on:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/jib-build-depoly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:

- name: 🐧 create service-account.json
run: |
mkdir -p ./daepiro-api/src/main/resources
cd ./daepiro-api/src/main/resources
touch ./service-account.json
echo "${{ secrets.FCM }}" | base64 --decode > ./service-account.json
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ out/

**/src/main/resources/service-account.json

*.yml
application.yml
application.properties

Expand Down
117 changes: 50 additions & 67 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,82 +1,65 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.4'
id 'io.spring.dependency-management' version '1.1.3'
id 'com.google.cloud.tools.jib' version '3.4.0'
id 'java'
id 'org.springframework.boot' version '3.1.4'
id 'io.spring.dependency-management' version '1.1.3'
id 'com.google.cloud.tools.jib' version '3.4.0'
}

group = 'com.numberone.backend'
version = '0.0.1-SNAPSHOT'
version = '0.0.2-SNAPSHOT'

allprojects {
apply plugin: 'java'
sourceCompatibility = JavaVersion.VERSION_17
apply plugin: 'java'
sourceCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
maven{url 'https://jitpack.io'}
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}

ext {
set('springCloudVersion', "2021.0.1")
queryDslVersion = "4.3.0"
set('springCloudVersion', "2021.0.1")
}


subprojects {
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
apply plugin: 'jacoco'

configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}

compileOnly {
extendsFrom annotationProcessor
}

all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}
}

repositories {
mavenCentral()
}

dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:3.1.4")
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

implementation 'org.springframework.boot:spring-boot-starter-undertow'

implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.10.3'
implementation 'com.google.code.gson:gson:2.10.1'

testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude module: 'junit'
}
testImplementation(platform('org.junit:junit-bom:5.9.3'))
testImplementation('org.junit.jupiter:junit-jupiter')
}


tasks.named('test') {
useJUnitPlatform()
}
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
apply plugin: 'jacoco'

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:3.1.4")
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

dependencies {
// lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

// spring
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-aop'

// swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

}

}
30 changes: 5 additions & 25 deletions daepiro-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,12 @@ dependencies {
implementation project(':daepiro-core')
implementation project(':daepiro-common')
implementation project(':daepiro-redis')
}

// spring
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
api 'org.springframework.boot:spring-boot-starter-data-jpa'

// lombok
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'

// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'

// aop
implementation 'org.springframework.boot:spring-boot-starter-aop'

// fcm
implementation 'com.google.firebase:firebase-admin:9.1.1'
bootJar {
enabled = false
}

tasks.named('test') {
useJUnitPlatform()
jar {
enabled = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ public Member findByEmail(String email) {
.orElseThrow(NotFoundMemberException::new);
}

@Transactional
public void create(String email) {
memberRepository.save(Member.of(email));
}

@Transactional
public void initMemberData(String email, OnboardingRequest onboardingRequest) {
Member member = memberRepository.findByEmail(email)
Expand Down
20 changes: 0 additions & 20 deletions daepiro-api/src/main/resources/logback-spring.xml

This file was deleted.

40 changes: 21 additions & 19 deletions daepiro-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,45 @@ dependencies {
implementation project(':daepiro-api')
implementation project(':daepiro-crawler')
implementation project(':daepiro-auth')

// spring
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'

// swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

// lombok
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'

}

tasks.named('test') {
useJUnitPlatform()
}

// system environment variables
def serverIP = System.getenv("EC2_PUBLIC_IP")
def jmxPort = System.getenv("JMX_PORT")
def dockerUserName = System.getenv("DOCKER_USERNAME")
def dockerImageName = System.getenv("DOCKER_IMAGE")

// jib
jib {
from {
image = "openjdk:17"
}
to {
image = "versatile0010/numberone"
image = String.format("%s/%s", dockerUserName, dockerImageName)
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"]
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 {
bootJar {
enabled = true // entry module
}
jar {
enabled = true
}

This file was deleted.

This file was deleted.

20 changes: 5 additions & 15 deletions daepiro-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,21 @@ dependencies {
implementation project(':daepiro-core')
implementation project(':daepiro-redis')
implementation project(':daepiro-common')
implementation project(':daepiro-api') // todo: remove it

// spring
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'

// lombok
compileOnly 'org.projectlombok:lombok'

// swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

// oauth
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'

// security
implementation 'org.springframework.boot:spring-boot-starter-security'

// jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'

}

tasks.bootJar {
bootJar {
enabled = false
}
jar {
enabled = true
}
Loading

0 comments on commit a2c3eb5

Please sign in to comment.