Skip to content

Commit

Permalink
πŸ”€ :: (#47) cloud-config μ„€μ •
Browse files Browse the repository at this point in the history
πŸ”€ :: (#47) cloud-config μ„€μ •
  • Loading branch information
eogus2513 authored Nov 18, 2022
2 parents 8db73d2 + df7f5b8 commit 40ff629
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/prod-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ jobs:
registry: ${{ steps.ecr.outputs.registry }}
tags: ${{ steps.get_version.outputs.VERSION }}
buildargs: |
JDBC_URL=${{secrets.JDBC_URL_PRODUCTION}}
DATABASE_PASSWORD=${{secrets.DATABASE_PASSWORD_PRODUCTION}}
DATABASE_USERNAME=${{secrets.DATABASE_USERNAME_PRODUCTION}}
PROFILE=prod
CLOUD_CONFIG_USERNAME=${{ secrets.CLOUD_CONFIG_USERNAME }}
CLOUD_CONFIG_PASSWORD=${{ secrets.CLOUD_CONFIG_PASSWORD }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ jobs:
registry: ${{ steps.ecr.outputs.registry }}
tags: ${{ github.sha }}
buildargs: |
JDBC_URL=${{secrets.JDBC_URL_STAGE}}
DATABASE_PASSWORD=${{secrets.DATABASE_PASSWORD_STAGE}}
DATABASE_USERNAME=${{secrets.DATABASE_USERNAME_STAGE}}
PROFILE=stag
CLOUD_CONFIG_USERNAME=${{ secrets.CLOUD_CONFIG_USERNAME }}
CLOUD_CONFIG_PASSWORD=${{ secrets.CLOUD_CONFIG_PASSWORD }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ EXPOSE 8080

COPY ./build/libs/*.jar app.jar

ARG JDBC_URL
ARG DATABASE_USERNAME
ARG DATABASE_PASSWORD
ARG PROFILE
ARG CLOUD_CONFIG_USERNAME
ARG CLOUD_CONFIG_PASSWORD

ENV JDBC_URL ${JDBC_URL}
ENV DATABASE_USERNAME ${DATABASE_USERNAME}
ENV DATABASE_PASSWORD ${DATABASE_PASSWORD}
ENV PROFILE ${PROFILE}
ENV CLOUD_CONFIG_USERNAME ${CLOUD_CONFIG_USERNAME}
ENV CLOUD_CONFIG_PASSWORD ${CLOUD_CONFIG_PASSWORD}

ENTRYPOINT ["java","-jar","/app.jar"]
ENTRYPOINT ["java","-jar","/app.jar"]
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ repositories {
mavenCentral()
}

dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2021.0.1")
}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
Expand All @@ -31,6 +37,7 @@ dependencies {
implementation 'org.apache.poi:poi-ooxml:4.1.2'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'org.springframework.cloud:spring-cloud-config-client'
}

tasks.named('test') {
Expand Down
31 changes: 24 additions & 7 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
spring:
application:
name: v1-dms-service
profiles:
active: ${PROFILE}
config:
import: optional:configserver:https://api.xquare.app/cloud-config/
cloud:
config:
username: ${CLOUD_CONFIG_USERNAME}
password: ${CLOUD_CONFIG_PASSWORD}

jpa:
show-sql: false
database: mysql
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
hibernate:
ddl-auto: none

datasource:
url: ${JDBC_URL}
url: ${db.url}
driver-class-name: com.mysql.cj.jdbc.Driver
password: ${DATABASE_PASSWORD}
username: ${DATABASE_USERNAME}
password: ${db.password}
username: ${db.username}

jackson:
property-naming-strategy: SNAKE_CASE

lifecycle:
timeout-per-shutdown-phase: 20s

server:
servlet:
context-path: /dms
shutdown: graceful

auth:
id: ${XQUARE_ADMIN_ID}
pw: ${XQUARE_ADMIN_PW}
id: ${xquare.admin.id}
pw: ${xquare.admin.pw}
jwt:
secret: ${JWT_SECRET}
secret: ${xquare.jwt}

0 comments on commit 40ff629

Please sign in to comment.