diff --git a/.github/workflows/aws-cicd-dev.yml b/.github/workflows/aws-cicd-dev.yml index 5a08d95f..bb0b5251 100644 --- a/.github/workflows/aws-cicd-dev.yml +++ b/.github/workflows/aws-cicd-dev.yml @@ -7,7 +7,6 @@ on: pull_request: branches: - develop - env: REGISTRY: "docker.io" NAMESPACE: "clean01" @@ -21,11 +20,18 @@ jobs: packages: write outputs: deploy_target: ${{ steps.set-env.outputs.DEPLOY_TARGET }} + steps: + + - name: Setup Env id: set-env run: | - echo "DEPLOY_TARGET=development" >> $GITHUB_OUTPUT + if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then + echo "DEPLOY_TARGET=production" >> $GITHUB_OUTPUT + else + echo "DEPLOY_TARGET=development" >> $GITHUB_OUTPUT + fi build: name: build @@ -36,7 +42,7 @@ jobs: packages: write env: - DEPLOY_TARGET: ${{ needs.setup.outputs.deploy_target }} + DEPLOY_TARGET: ${{ needs.setup.outputs.deploy_target }} # 이부분 REGISTRY: "docker.io" NAMESPACE: "clean01" APPLICATION_SECRET_PROPERTIES: ${{ secrets.AWS_APPLICATION_SECRET_PROPERTIES }} @@ -59,7 +65,7 @@ jobs: run: | echo "${APPLICATION_SECRET_PROPERTIES}" > ./layer-api/src/main/resources/application-secret.properties echo "${APPLICATION_SECRET_PROPERTIES}" > ./layer-batch/src/main/resources/application-secret.properties - echo "${APPLICATION_SECRET_PROPERTIES}" > ./layer-admin/src/main/resources/application-secret.properties + echo "${APPLICATION_SECRET_PROPERTIES}" > ./layer-admin/src/main/resources/application-secret.properties - name: Build layer-api module run: ./gradlew :layer-api:build @@ -92,38 +98,45 @@ jobs: images: | ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-api ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-batch - ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-admin + ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-admin - name: Push layer-api Docker Image uses: docker/build-push-action@v4 with: context: ./layer-api - file: ./layer-api/Dockerfile-dev # Dockerfile 이름 지정 + file: ./layer-api/Dockerfile # Dockerfile 이름 지정 platforms: linux/amd64 push: true tags: | ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-api:latest - + build-args: | + SPRING_PROFILE=dev + no-cache: true - name: Push layer-batch Docker Image uses: docker/build-push-action@v4 with: context: ./layer-batch - file: ./layer-batch/Dockerfile-batch # Dockerfile 이름 지정 + file: ./layer-batch/Dockerfile # Dockerfile 이름 지정 platforms: linux/amd64 push: true tags: | ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-batch:latest + build-args: | + SPRING_PROFILE=dev + no-cache: true - name: Push layer-admin Docker Image uses: docker/build-push-action@v4 with: context: ./layer-admin - file: ./layer-admin/Dockerfile-admin # Dockerfile 이름 지정 + file: ./layer-admin/Dockerfile # Dockerfile 이름 지정 platforms: linux/amd64 push: true tags: | ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-admin:latest + build-args: | + SPRING_PROFILE=dev deploy: name: Deploy @@ -132,6 +145,7 @@ jobs: if: github.event_name != 'pull_request' env: DEPLOY_TARGET: ${{ needs.setup.outputs.deploy_target }} + HOST_IP: ${{ needs.setup.outputs.host_ip }} steps: - name: Checkout sources @@ -171,6 +185,17 @@ jobs: sudo chown -R ubuntu:ubuntu /home/ubuntu/layer-api/infra/${{ env.DEPLOY_TARGET }} + - name: Set Permissions on Transferred Files + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.AWS_DEV_INSTANCE_HOST }} + username: ubuntu + key: ${{ secrets.AWS_INSTANCE_PEM }} + port: 22 + script: | + sudo chmod -R 755 /home/ubuntu/layer-api/infra/${{ env.DEPLOY_TARGET }} + sudo chown -R ubuntu:ubuntu /home/ubuntu/layer-api/infra/${{ env.DEPLOY_TARGET }} + - name: Deploy with Docker Compose uses: appleboy/ssh-action@master with: @@ -184,5 +209,6 @@ jobs: sudo apt install docker-compose sudo docker login --username ${{ secrets.DOCKER_EMAIL }} --password ${{ secrets.DOCKER_PASSWORD }} cd /home/ubuntu/layer-api/infra/${{ env.DEPLOY_TARGET }} - sudo docker-compose pull && sudo docker-compose up -d + chmod 777 ./deploy.sh + ./deploy.sh sudo docker image prune -a -f diff --git a/.github/workflows/aws-cicd-prod.yml b/.github/workflows/aws-cicd-prod.yml index 249c4645..3eb711a6 100644 --- a/.github/workflows/aws-cicd-prod.yml +++ b/.github/workflows/aws-cicd-prod.yml @@ -21,6 +21,7 @@ jobs: packages: write outputs: deploy_target: ${{ steps.set-env.outputs.DEPLOY_TARGET }} + steps: - name: Setup Env id: set-env @@ -36,7 +37,7 @@ jobs: packages: write env: - DEPLOY_TARGET: ${{ needs.setup.outputs.deploy_target }} + DEPLOY_TARGET: ${{ needs.setup.outputs.deploy_target }} # 이부분 REGISTRY: "docker.io" NAMESPACE: "clean01" APPLICATION_SECRET_PROPERTIES: ${{ secrets.AWS_APPLICATION_SECRET_PROPERTIES }} @@ -98,33 +99,39 @@ jobs: uses: docker/build-push-action@v4 with: context: ./layer-api - file: ./layer-api/Dockerfile-prod # Dockerfile 이름 지정 + file: ./layer-api/Dockerfile # Dockerfile 이름 지정 platforms: linux/amd64 push: true tags: | ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-api:latest + build-args: | + SPRING_PROFILE=prod no-cache: true - name: Push layer-batch Docker Image uses: docker/build-push-action@v4 with: context: ./layer-batch - file: ./layer-batch/Dockerfile-batch # Dockerfile 이름 지정 + file: ./layer-batch/Dockerfile # Dockerfile 이름 지정 platforms: linux/amd64 push: true tags: | ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-batch:latest + build-args: | + SPRING_PROFILE=prod no-cache: true - name: Push layer-admin Docker Image uses: docker/build-push-action@v4 with: context: ./layer-admin - file: ./layer-admin/Dockerfile-admin # Dockerfile 이름 지정 + file: ./layer-admin/Dockerfile # Dockerfile 이름 지정 platforms: linux/amd64 push: true tags: | ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}_layer-admin:latest + build-args: | + SPRING_PROFILE=prod deploy: name: Deploy @@ -133,6 +140,7 @@ jobs: if: github.event_name != 'pull_request' env: DEPLOY_TARGET: ${{ needs.setup.outputs.deploy_target }} + HOST_IP: ${{ needs.setup.outputs.host_ip }} steps: - name: Checkout sources @@ -151,7 +159,7 @@ jobs: - name: Send Docker Compose uses: appleboy/scp-action@master with: - host: ${{ secrets.AWS_PROD_INSTANCE_HOST }} + host: ${{ secrets.AWS_PROD_INSTANCE_HOST }} # aws-cicd-dev.yml과 분리한 이유 username: ubuntu key: ${{ secrets.AWS_INSTANCE_PEM }} port: 22 diff --git a/layer-admin/Dockerfile-admin b/layer-admin/Dockerfile similarity index 53% rename from layer-admin/Dockerfile-admin rename to layer-admin/Dockerfile index 7c2422f7..a25600d3 100644 --- a/layer-admin/Dockerfile-admin +++ b/layer-admin/Dockerfile @@ -7,4 +7,4 @@ COPY ${JAR_FILE} layer-admin.jar ENV SPRING_PROFILE=${SPRING_PROFILE} -ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul" ,"-jar" ,"layer-admin.jar"] \ No newline at end of file +ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul", "-Dspring.profiles.active=${SPRING_PROFILE}","-jar" ,"layer-admin.jar"] \ No newline at end of file diff --git a/layer-api/Dockerfile-dev b/layer-api/Dockerfile similarity index 55% rename from layer-api/Dockerfile-dev rename to layer-api/Dockerfile index cbb49e2e..04505691 100644 --- a/layer-api/Dockerfile-dev +++ b/layer-api/Dockerfile @@ -1,4 +1,10 @@ FROM openjdk:17 + ARG JAR_FILE=./build/libs/*.jar +ARG SPRING_PROFILE + COPY ${JAR_FILE} layer-server.jar -ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=dev" ,"-jar" ,"layer-server.jar"] \ No newline at end of file + +ENV SPRING_PROFILE=${SPRING_PROFILE} + +ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=${SPRING_PROFILE}" ,"-jar" ,"layer-server.jar"] \ No newline at end of file diff --git a/layer-api/Dockerfile-prod b/layer-api/Dockerfile-prod deleted file mode 100644 index 1cc729ea..00000000 --- a/layer-api/Dockerfile-prod +++ /dev/null @@ -1,4 +0,0 @@ -FROM openjdk:17 -ARG JAR_FILE=./build/libs/*.jar -COPY ${JAR_FILE} layer-server.jar -ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=prod" ,"-jar" ,"layer-server.jar"] \ No newline at end of file diff --git a/layer-api/infra/development/deploy.sh b/layer-api/infra/development/deploy.sh new file mode 100644 index 00000000..f733f711 --- /dev/null +++ b/layer-api/infra/development/deploy.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +IS_GREEN=$(sudo docker ps | grep layer-api-green) # 현재 실행중인 App이 blue인지 확인합니다. +DEFAULT_CONF="/etc/nginx/nginx.conf" + + +if [ -z $IS_GREEN ];then # blue라면 + + echo "### BLUE => GREEN ###" + + echo "1. get green image" + cd ./layer-api/infra/production + + echo "1.1. pull latest green image" + sudo docker-compose -f docker-compose-green.yaml pull + + echo "2. green container up" + sudo docker-compose -f docker-compose-green.yaml up -d + + while [ 1 = 1 ]; do + echo "3. green health check..." + sudo sleep 3 + + REQUEST=$(sudo curl http://127.0.0.1:8080/actuator/health) # green으로 request + if [ -n "$REQUEST" ]; then # 서비스 가능하면 health check 중지 + echo "health check success" + break ; + fi + done; + + echo "4. reload nginx" + sudo cp ./nginx.green.conf /etc/nginx/nginx.conf + sudo nginx -s reload + + echo "5. blue container down" + sudo docker-compose -f docker-compose-blue.yaml rm -s -f layer-api-blue batch-job-blue admin-app-blue +else + echo "### GREEN => BLUE ###" + echo "1. get blue image" + cd ./layer-api/infra/production + + echo "1.1. pull latest blue image" + sudo docker-compose -f docker-compose-blue.yaml pull + + echo "2. blue container up" + sudo docker-compose -f docker-compose-blue.yaml up -d + + + while [ 1 = 1 ]; do + echo "3. blue health check..." + sleep 3 + REQUEST=$(curl http://127.0.0.1:8081/actuator/health) # blue로 request + + if [ -n "$REQUEST" ]; then # 서비스 가능하면 health check 중지 + echo "health check success" + break ; + fi + done; + + echo "4. reload nginx" + sudo cp ./nginx.blue.conf /etc/nginx/nginx.conf + sudo nginx -s reload + + echo "5. green container down" + sudo docker-compose -f docker-compose-green.yaml rm -s -f layer-api-green batch-job-green admin-app-green +fi \ No newline at end of file diff --git a/layer-api/infra/development/docker-compose-blue.yaml b/layer-api/infra/development/docker-compose-blue.yaml new file mode 100644 index 00000000..ee6b51a6 --- /dev/null +++ b/layer-api/infra/development/docker-compose-blue.yaml @@ -0,0 +1,78 @@ +services: + redis: + build: + context: . + dockerfile: Dockerfile-redis + ports: + - "6379:6379" + volumes: + - redis-data:/data # Persistent data storage + restart: always + networks: + - app-network + + layer-api-blue: + image: docker.io/clean01/layer-server_layer-api:latest + container_name: layer-api-blue + ports: + - "8081:8080" + environment: + - TZ=Asia/Seoul + - SPRING_PROFILES_ACTIVE=dev + volumes: + - ./application-secret.properties:/config/application-secret.properties + - ./tokens:/config/tokens + networks: + - app-network + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + + batch-job-blue: + image: docker.io/clean01/layer-server_layer-batch:latest + container_name: layer-batch-blue + environment: + - TZ=Asia/Seoul + volumes: + - ./application-secret.properties:/config/application-secret.properties + - ./tokens:/config/tokens + networks: + - app-network + depends_on: + - layer-api-blue + restart: always + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + + admin-app-blue: + image: docker.io/clean01/layer-server_layer-admin:latest # + container_name: layer-admin-blue + ports: + - "3001:3000" + environment: + - TZ=Asia/Seoul + - SPRING_PROFILES_ACTIVE=dev + volumes: + - ./application-secret.properties:/config/application-secret.properties + - ./tokens:/config/tokens + networks: + - app-network + depends_on: + - layer-api-blue + restart: always + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + +networks: + app-network: + +volumes: + redis-data: \ No newline at end of file diff --git a/layer-api/infra/development/docker-compose.yaml b/layer-api/infra/development/docker-compose-green.yaml similarity index 73% rename from layer-api/infra/development/docker-compose.yaml rename to layer-api/infra/development/docker-compose-green.yaml index 340313bd..67f495d6 100644 --- a/layer-api/infra/development/docker-compose.yaml +++ b/layer-api/infra/development/docker-compose-green.yaml @@ -11,9 +11,9 @@ services: networks: - app-network - java-app: + layer-api-green: image: docker.io/clean01/layer-server_layer-api:latest - container_name: layer-api + container_name: layer-api-green ports: - "8080:8080" environment: @@ -28,11 +28,11 @@ services: driver: "json-file" options: max-size: "10m" - max-file: "5" + max-file: "3" - batch-job: - image: docker.io/clean01/layer-server_layer-batch:latest # - container_name: layer-batch + batch-job-green: + image: docker.io/clean01/layer-server_layer-batch:latest + container_name: layer-batch-green environment: - TZ=Asia/Seoul volumes: @@ -41,17 +41,17 @@ services: networks: - app-network depends_on: - - java-app + - layer-api-green restart: always logging: driver: "json-file" options: max-size: "10m" - max-file: "5" + max-file: "3" - admin-app: + admin-app-green: image: docker.io/clean01/layer-server_layer-admin:latest # - container_name: layer-admin + container_name: layer-admin-green ports: - "3000:3000" environment: @@ -63,25 +63,13 @@ services: networks: - app-network depends_on: - - java-app + - layer-api-green restart: always logging: driver: "json-file" options: max-size: "10m" - max-file: "5" - - nginx: - image: nginx:latest - container_name: nginx - depends_on: - - java-app - ports: - - "80:80" - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf - networks: - - app-network + max-file: "3" networks: app-network: diff --git a/layer-api/infra/development/nginx.conf b/layer-api/infra/development/nginx.blue.conf similarity index 93% rename from layer-api/infra/development/nginx.conf rename to layer-api/infra/development/nginx.blue.conf index 530c5113..e5f5348a 100644 --- a/layer-api/infra/development/nginx.conf +++ b/layer-api/infra/development/nginx.blue.conf @@ -2,11 +2,11 @@ events { } http { upstream layer-api { - server layer-api:8080; + server localhost:8081; } upstream layer-admin { - server layer-admin:3000; + server localhost:3001; } # api.layerapp.io에 대한 서버 블록 @@ -36,4 +36,4 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } } -} \ No newline at end of file +} diff --git a/layer-api/infra/development/nginx.green.conf b/layer-api/infra/development/nginx.green.conf new file mode 100644 index 00000000..fcab1cc4 --- /dev/null +++ b/layer-api/infra/development/nginx.green.conf @@ -0,0 +1,39 @@ +events { } + +http { + upstream layer-api { + server localhost:8080; + } + + upstream layer-admin { + server localhost:3000; + } + + # api.layerapp.io에 대한 서버 블록 + server { + listen 80; + server_name stgapi.layerapp.io; + + location / { + proxy_pass http://layer-api; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + + # admin.api.layerapp.io에 대한 서버 블록 + server { + listen 80; + server_name admin-dev.layerapp.io; + + location / { + proxy_pass http://layer-admin; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } +} diff --git a/layer-api/infra/production/deploy.sh b/layer-api/infra/production/deploy.sh index 27977d8f..f733f711 100644 --- a/layer-api/infra/production/deploy.sh +++ b/layer-api/infra/production/deploy.sh @@ -21,7 +21,7 @@ if [ -z $IS_GREEN ];then # blue라면 echo "3. green health check..." sudo sleep 3 - REQUEST=$(sudo curl http://127.0.0.1:8080/greeting) # green으로 request + REQUEST=$(sudo curl http://127.0.0.1:8080/actuator/health) # green으로 request if [ -n "$REQUEST" ]; then # 서비스 가능하면 health check 중지 echo "health check success" break ; @@ -49,7 +49,7 @@ else while [ 1 = 1 ]; do echo "3. blue health check..." sleep 3 - REQUEST=$(curl http://127.0.0.1:8081/greeting) # blue로 request + REQUEST=$(curl http://127.0.0.1:8081/actuator/health) # blue로 request if [ -n "$REQUEST" ]; then # 서비스 가능하면 health check 중지 echo "health check success" diff --git a/layer-api/src/main/java/org/layer/config/SecurityConfig.java b/layer-api/src/main/java/org/layer/config/SecurityConfig.java index 266ed332..83b397ed 100644 --- a/layer-api/src/main/java/org/layer/config/SecurityConfig.java +++ b/layer-api/src/main/java/org/layer/config/SecurityConfig.java @@ -59,7 +59,7 @@ private void setHttp(HttpSecurity http) throws Exception { .requestMatchers(new AntPathRequestMatcher("/api/auth/oauth2/apple")).permitAll() .requestMatchers(new AntPathRequestMatcher("/api/auth/create-token")).permitAll() .requestMatchers(new AntPathRequestMatcher("/admin/**")).permitAll() - .requestMatchers(new AntPathRequestMatcher("/greeting")).permitAll() + .requestMatchers(new AntPathRequestMatcher("/actuator/health")).permitAll() .anyRequest().authenticated() ) .headers(headers -> headers diff --git a/layer-api/src/main/java/org/layer/domain/etc/TempController.java b/layer-api/src/main/java/org/layer/domain/etc/TempController.java deleted file mode 100644 index aef6a6d7..00000000 --- a/layer-api/src/main/java/org/layer/domain/etc/TempController.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.layer.domain.etc; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class TempController { - @GetMapping("/greeting") - public String greeting(@Value("${greeting.message}") String greeting) { - return greeting; - } -} diff --git a/layer-api/src/main/resources/application-dev.yml b/layer-api/src/main/resources/application-dev.yml index 61f8666b..22f8d339 100644 --- a/layer-api/src/main/resources/application-dev.yml +++ b/layer-api/src/main/resources/application-dev.yml @@ -90,3 +90,11 @@ discord: retrospect-url: ${DISCORD_RETROSPECT_URL} space-url: ${DISCORD_SPACE_URL} member-url: ${DISCORD_MEMBER_URL} + +# actuator +management: + endpoints: + enabled-by-default: false + endpoint: + health: + enabled: true \ No newline at end of file diff --git a/layer-api/src/main/resources/application-prod.yml b/layer-api/src/main/resources/application-prod.yml index c6fc358d..77dd31de 100644 --- a/layer-api/src/main/resources/application-prod.yml +++ b/layer-api/src/main/resources/application-prod.yml @@ -90,3 +90,11 @@ discord: retrospect-url: ${DISCORD_RETROSPECT_URL} space-url: ${DISCORD_SPACE_URL} member-url: ${DISCORD_MEMBER_URL} + +# actuator +management: + endpoints: + enabled-by-default: false + endpoint: + health: + enabled: true \ No newline at end of file diff --git a/layer-batch/Dockerfile-batch b/layer-batch/Dockerfile similarity index 53% rename from layer-batch/Dockerfile-batch rename to layer-batch/Dockerfile index 1176e233..9824e545 100644 --- a/layer-batch/Dockerfile-batch +++ b/layer-batch/Dockerfile @@ -7,4 +7,4 @@ COPY ${JAR_FILE} layer-batch.jar ENV SPRING_PROFILE=${SPRING_PROFILE} -ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul" ,"-jar" ,"layer-batch.jar"] \ No newline at end of file +ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul", "-Dspring.profiles.active=${SPRING_PROFILE}", "-jar" ,"layer-batch.jar"] \ No newline at end of file diff --git a/layer-batch/src/main/resources/application-dev.yml b/layer-batch/src/main/resources/application-dev.yml new file mode 100644 index 00000000..11274e3e --- /dev/null +++ b/layer-batch/src/main/resources/application-dev.yml @@ -0,0 +1,71 @@ +server: + port: 8085 + +spring: + config: + import: application-secret.properties + datasource: + url: ${AWS_DEV_DB_URL} + username: ${AWS_PROD_DB_NAME} + password: ${AWS_PROD_DB_PASSWORD} + driver-class-name: com.mysql.cj.jdbc.Driver + hikari: + maximum-pool-size: 5 # 최대 pool 크기 + minimum-idle: 5 # 최소 pool 크기 + jpa: + hibernate: + ddl-auto: validate + properties: + hibernate: + format_sql: true + show_sql: true + open-in-view: false + database: mysql + +apple: + login: + issuer: ${DEV_APPLE_ISSUER} + client_id: ${DEV_APPLE_CLIENT_ID} + audience: ${DEV_APPLE_AUD} + +kakao: + login: + api_key: ${DEV_KAKAO_API_KEY} + redirect_uri: ${DEV_KAKAO_REDIRECT_URI} + uri: + base: https://kauth.kakao.com + code: /oauth/authorize + token: /oauth/token + api: + uri: + base: https://kapi.kakao.com + user: /v2/user/me + +google: + login: + client_id: ${DEV_GOOGLE_CLIENT_ID} + code_uri: ${DEV_GOOGLE_CODE_URI} + token_uri: ${DEV_GOOGLE_TOKEN_URI} + client_secret: ${DEV_GOOGLE_CLIENT_SECRET} + redirect_uri: ${DEV_GOOGLE_REDIRECT_URI} + code_redirect_uri: http://localhost:8080/api/auth/oauth2/google/code + +ncp: + storage: + region: ${STORAGE_REGION} + bucketName: ${STORAGE_NAME} + endpoint: ${STORAGE_ENDPOINT} + accessKey: ${STORAGE_ACCESS_KEY} + secretKey: ${STORAGE_SECRET_KEY} + +openai: + systemContent: ${OPENAI_SYSTEM_CONTENT} + apiKey: ${OPENAI_API_KEY} + model: ${OPENAI_MODEL} + maxTokens: ${OPENAI_MAX_TOKENS} + +discord: + webhook: + retrospect-url: ${DISCORD_RETROSPECT_URL} + space-url: ${DISCORD_SPACE_URL} + member-url: ${DISCORD_MEMBER_URL} \ No newline at end of file diff --git a/layer-batch/src/main/resources/application.yml b/layer-batch/src/main/resources/application-prod.yml similarity index 92% rename from layer-batch/src/main/resources/application.yml rename to layer-batch/src/main/resources/application-prod.yml index d009e947..365a340b 100644 --- a/layer-batch/src/main/resources/application.yml +++ b/layer-batch/src/main/resources/application-prod.yml @@ -49,10 +49,6 @@ google: client_secret: ${DEV_GOOGLE_CLIENT_SECRET} redirect_uri: ${DEV_GOOGLE_REDIRECT_URI} code_redirect_uri: http://localhost:8080/api/auth/oauth2/google/code - sheet: - id: ${GOOGLE_SHEET_ID} - token_path: ${PROD_GOOGLE_TOKEN_PATH} - credential_path: ${PROD_GOOGLE_CREDENTIAL_PATH} ncp: storage: