Skip to content

Commit

Permalink
Merge pull request #24 from dnd-side-project/Chore/#23
Browse files Browse the repository at this point in the history
Chore/#23: 배포 관련 재설정
  • Loading branch information
abc5259 authored Jul 31, 2024
2 parents 70f65cb + 80dae58 commit d4dc455
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
distribution: temurin
java-version: 17

- name: application-secret.yml 파일 만들기
run: echo "${{ secrets.APPLICATION_SECRET }}" > ./src/main/resources/application-secret.yml

- name: 테스트 및 빌드하기
run: ./gradlew clean build

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/dnd/snappy/domain/common/BaseEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
Expand All @@ -16,6 +18,8 @@
@EntityListeners(AuditingEntityListener.class)
@MappedSuperclass
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SuperBuilder(toBuilder = true)
public class BaseEntity {

@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
33 changes: 30 additions & 3 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
server:
port: 8080
spring:
transaction:
default-timeout: '${custom.transaction.default-timeout}'
profiles:
active: prod
active: dev
include: secret

---
spring:
config:
activate:
on-profile: dev
transaction:
default-timeout: '${custom.transaction.default-timeout}'
datasource:
hikari:
maximum-pool-size: '${custom.hikari.maximum-pool-size}'
Expand All @@ -23,4 +29,25 @@ spring:
show_sql: true
use_sql_comments: true
default_batch_fetch_size: 1000
defer-datasource-initialization: true

---
spring:
config:
activate:
on-profile: test

datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:test
username: h2
password:
jpa:
properties:
hibernate:
default_batch_fetch_size: 1000
format_sql: true
show_sql: true
hibernate:
ddl-auto: create
defer-datasource-initialization: true
2 changes: 2 additions & 0 deletions src/test/java/com/dnd/snappy/SnappyApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@SpringBootTest
@ActiveProfiles("test")
class SnappyApplicationTests {

@Test
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/dnd/snappy/config/ApiDocumentUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.dnd.snappy.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Import;
import org.springframework.restdocs.RestDocumentationContextProvider;
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler;
Expand All @@ -11,6 +12,7 @@
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.filter.CharacterEncodingFilter;

@Import(RestDocsConfiguration.class)
@Component
public class ApiDocumentUtils {

Expand Down

0 comments on commit d4dc455

Please sign in to comment.