Skip to content

Commit

Permalink
Merge pull request #26 from woowa-camp-2023-4/dev
Browse files Browse the repository at this point in the history
sync main
  • Loading branch information
chanwooDev authored Aug 15, 2023
2 parents c91be1a + 2c7d018 commit 4699fa1
Show file tree
Hide file tree
Showing 42 changed files with 150 additions and 38 deletions.
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Description

## Changes

## Test Checklist
34 changes: 34 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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: [ "dev" ]
pull_request:
branches: [ "dev" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build
54 changes: 34 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
# Compiled class file
*.class
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

# Log file
*.log

# BlueJ files
*.ctxt
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

# Mobile Tools for Java (J2ME)
.mtj.tmp/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
*.log
out/
!**/src/main/**/out/
!**/src/test/**/out/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
### VS Code ###
.vscode/
db/
36 changes: 19 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.14'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'java'
id 'org.springframework.boot' version '2.7.14'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}

group = 'com.woowa'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '11'
sourceCompatibility = '11'
}

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-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.rest-assured:rest-assured:4.4.0'
}

tasks.named('test') {
useJUnitPlatform()
useJUnitPlatform()
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
1 change: 0 additions & 1 deletion src/main/resources/application.properties

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logging:
config: classpath:logback-spring-${spring.profiles.active}.xml
9 changes: 9 additions & 0 deletions src/main/resources/logback-spring-local.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> <!--디폴스 설정 include -->
<include
resource="org/springframework/boot/logging/logback/console-appender.xml"/> <!--콘솔에 로그를 찍기위해 console-appender include-->
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
27 changes: 27 additions & 0 deletions src/main/resources/logback-spring-prod.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>

<property resource="logback-variables.properties"/>

<appender name="REQUEST-RESPONSE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/logRequest-response.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIR}/info/logRequest-response.log.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize> <!-- 한 파일의 최대 용량 -->
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>180</maxHistory> <!-- 한 파일의 최대 저장 기한 (단위 : 일) -->
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
[REQUEST-RESPONSE] %X{ID} ${FILE_LOG_PATTERN}
</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="REQUEST-RESPONSE"/>
</root>
</configuration>
2 changes: 2 additions & 0 deletions src/main/resources/logback-variables.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LOG_DIR=logs
LOG_PATTERN=[%-5level] %d{yyyy-MM--DD HH:mm:ss} [%thread] [%logger{50}:%line] - %msg%n
18 changes: 18 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
spring:
jpa:
hibernate:
ddl-auto: validate
show-sql: true
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
format_sql: true
sql:
init:
schema-locations: classpath*:schema.sql
mode: always
datasource:
url: jdbc:h2:mem:testdb
driver-class-name: org.h2.Driver
username: sa
password:

0 comments on commit 4699fa1

Please sign in to comment.