Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci-cd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,7 @@ jobs:
docker stop auth-service || true
docker rm auth-service || true
docker pull ${{ secrets.DOCKER_USERNAME }}/cantech:${{ github.sha }}
docker run -d --name auth-service -p 8081:8081 ${{ secrets.DOCKER_USERNAME }}/cantech:${{ github.sha }}
docker run -d --name auth-service -p 8081:8081 \
-e SPRING_PROFILES_ACTIVE=prod \
-e CONFIG_SERVER_URL="${{ secrets.CONFIG_SERVER_URL }}" \
${{ secrets.DOCKER_USERNAME }}/cantech:${{ github.sha }}
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ dependencies {
// Lombok (테스트 환경)
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")

// Spring Cloud Config
implementation("org.springframework.cloud:spring-cloud-starter-config")
testImplementation("com.h2database:h2")
}

dependencyManagement {
Expand Down
13 changes: 12 additions & 1 deletion src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
spring.config.import=optional:configserver:

eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
eureka.client.service-url.defaultZone=${EUREKA_SERVER_URL}

spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=${DATABASE_URL}
spring.datasource.username=${DATABASE_USERNAME}
spring.datasource.password=${DATABASE_PASSWORD}
spring.datasource.password=${DATABASE_PASSWORD}

spring.jpa.database=postgresql
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true

server.port=8081
6 changes: 1 addition & 5 deletions src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
eureka.client.service-url.defaultZone=${EUREKA_SERVER_URL}

spring.datasource.url=${DATABASE_URL}
spring.datasource.username=${DATABASE_USERNAME}
spring.datasource.password=${DATABASE_PASSWORD}
spring.config.import=optional:configserver:${CONFIG_SERVER_URL}
7 changes: 7 additions & 0 deletions src/main/resources/application-test.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
spring.datasource.url=${DATABASE_URL:jdbc:h2:mem:testdb}
spring.datasource.username=${DATABASE_USERNAME:sa}
spring.datasource.password=${DATABASE_PASSWORD:}
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect

spring.cloud.config.enabled=false
eureka.client.enabled=false
12 changes: 2 additions & 10 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
spring.application.name=auth-service
server.port=8081
spring.application.name=auth

eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true

spring.jpa.database=postgresql
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true

spring.datasource.driver-class-name=org.postgresql.Driver
spring.profiles.active=${SPRING_PROFILES_ACTIVE:dev}
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 AuthServiceApplicationTests {

@Test
Expand Down