From 8f7ab5a5a77a5346c32d7aa897cc70a1844fb790 Mon Sep 17 00:00:00 2001 From: unanchoi Date: Tue, 28 Nov 2023 23:38:17 +0900 Subject: [PATCH] =?UTF-8?q?[CHORE]=20application=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-dev.yml | 16 ++------ .github/workflows/cd-prod.yml | 16 ++------ .github/workflows/ci.yml | 16 ++------ .gitignore | 6 +-- src/main/resources/application-dev.yml | 50 +++++++++++++++++++++++++ src/main/resources/application-prod.yml | 43 +++++++++++++++++++++ 6 files changed, 108 insertions(+), 39 deletions(-) create mode 100644 src/main/resources/application-dev.yml create mode 100644 src/main/resources/application-prod.yml diff --git a/.github/workflows/cd-dev.yml b/.github/workflows/cd-dev.yml index 969bd967..0539f471 100644 --- a/.github/workflows/cd-dev.yml +++ b/.github/workflows/cd-dev.yml @@ -19,20 +19,12 @@ jobs: distribution: 'temurin' cache: gradle - - name: create .env file - working-directory: ./ + - name: Create application-secret.yml run: | pwd - touch .env - echo "${{ secrets.ENV }}" >> .env - cat .env - - - name: Create application.yml - run: | - pwd - touch src/main/resources/application.yml - echo "${{ secrets.APPLICATION_YML }}" >> src/main/resources/application.yml - cat src/main/resources/application.yml + touch src/main/resources/application-secret.yml + echo "${{ secrets.APPLICATION_SECRET_YML }}" >> src/main/resources/application-secret.yml + cat src/main/resources/application-secret.yml - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 diff --git a/.github/workflows/cd-prod.yml b/.github/workflows/cd-prod.yml index f9af02d9..bf9bdb4d 100644 --- a/.github/workflows/cd-prod.yml +++ b/.github/workflows/cd-prod.yml @@ -19,20 +19,12 @@ jobs: distribution: 'temurin' cache: gradle - - name: create .env file - working-directory: ./ + - name: Create application-secret.yml run: | pwd - touch .env - echo "${{ secrets.ENV }}" >> .env - cat .env - - - name: Create application.yml - run: | - pwd - touch src/main/resources/application.yml - echo "${{ secrets.APPLICATION_PROD_YML }}" >> src/main/resources/application.yml - cat src/main/resources/application.yml + touch src/main/resources/application-secret.yml + echo "${{ secrets.APPLICATION_SECRET_YML }}" >> src/main/resources/application-secret.yml + cat src/main/resources/application-secret.yml - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bab8db65..99d7e680 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,20 +19,12 @@ jobs: distribution: 'temurin' cache: gradle - - name: create .env file - working-directory: ./ + - name: Create application-secret.yml run: | pwd - touch .env - echo "${{ secrets.ENV }}" >> .env - cat .env - - - name: Create application.yml - run: | - pwd - touch src/main/resources/application.yml - echo "${{ secrets.APPLICATION_YML }}" >> src/main/resources/application.yml - cat src/main/resources/application.yml + touch src/main/resources/application-secret.yml + echo "${{ secrets.APPLICATION_SECRET_YML }}" >> src/main/resources/application-secret.yml + cat src/main/resources/application-secret.yml - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 diff --git a/.gitignore b/.gitignore index 4e0ae009..2c2b599e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,10 +37,10 @@ out/ .vscode/ application.properties -application-dev.yml -application-prod.yml application-oauth2.yml *.properties .env smeem_fcm.json -.DS_Store \ No newline at end of file +.DS_Store + +application-secret.yml \ No newline at end of file diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 00000000..721c5d22 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,50 @@ +spring: + config: + import: application-secret.yml + activate: + on-profile: dev + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://${DATABASE.ENDPOINT_URL.dev}:5432/postgres?currentSchema=${DATABASE.NAME.dev} + username: ${DATABASE.USERNAME.dev} + password: ${DATABASE.PASSWORD.dev} + jpa: + hibernate: + ddl-auto: none + properties: + hibernate: + format_sql: true + default_batch_fetch_size: 1000 + auto_quote_keyword: true + +logging.level: + org.hibernate.SQL: debug + +fcm: + file_path: smeem_fcm.json + url: ${FCM.URL} + google_api: https://www.googleapis.com/auth/cloud-platform + smeem_title: "오늘의 영어 훈련, 딱 5분 걸려요!" + smeem_body: "지금 눌러서 일기 쓰기 ✍️" + +jwt: + secret: ${JWT.SECRET} + KAKAO_URL: https://kapi.kakao.com/v2/user/me + APPLE_URL: https://appleid.apple.com/auth/keys + ACCESS_TOKEN_EXPIRED: 7200000 + REFRESH_TOKEN_EXPIRED: 1209600000 + +badge: + welcome-badge-id: ${WELCOME_BADGE_ID} + +springdoc: + default-consumes-media-type: application/json;charset=UTF-8 + default-produces-media-type: application/json;charset=UTF-8 + swagger-ui: + url: /docs/open-api-3.0.1.json + path: /swagger + +smeem: + duration: + expired: ${SMEEM.DURATION.EXPIRED} + remind: ${SMEEM.DURATION.REMIND} \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 00000000..9e89b197 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,43 @@ +spring: + config: + activate: + on-profile: prod + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://${DATABASE.ENDPOINT_URL.prod}:5432/postgres?currentSchema=${DATABASE.NAME.prod} + username: ${DATABASE.USERNAME.prod} + password: ${DATABASE.PASSWORD.prod} + + jpa: + hibernate: + ddl-auto: none + properties: + hibernate: + format_sql: true + default_batch_fetch_size: 1000 + auto_quote_keyword: true + +logging.level: + org.hibernate.SQL: debug + +fcm: + file_path: smeem_fcm.json + url: ${FCM.URL} + google_api: https://www.googleapis.com/auth/cloud-platform + smeem_title: "오늘의 영어 훈련, 딱 5분 걸려요!" + smeem_body: "지금 눌러서 일기 쓰기 ✍️" + +jwt: + secret: ${JWT.SECRET} + KAKAO_URL: https://kapi.kakao.com/v2/user/me + APPLE_URL: https://appleid.apple.com/auth/keys + ACCESS_TOKEN_EXPIRED: 7200000 + REFRESH_TOKEN_EXPIRED: 1209600000 + +badge: + welcome-badge-id: ${WELCOME_BADGE_ID} + +smeem: + duration: + expired: ${SMEEM.DURATION.EXPIRED} + remind: ${SMEEM.DURATION.REMIND} \ No newline at end of file