-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: application 추적에 다른 CICD 파이프라인 수정 & JWT 토큰 개별화로 클라이언트 접근 방지 #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
efb85cd
feat: 애플리케이션 환경 설정 파일 추가 및 .gitignore 수정
jayn2u ab2fd95
feat: Swagger UI 경로 수정
jayn2u 8943439
feat: 개별 배포 테스트를 위한 GitHub Actions 워크플로우 추가
jayn2u d98bf3a
feat: GitHub Actions 워크플로우에서 브랜치 이름 수정 및 환경별 설정 개선
jayn2u 1eb5d72
refactor: 개발 및 운영 서버 배포를 위한 GitHub Actions 워크플로우 추가
jayn2u File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| name: Individual Deploy Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ "develop" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| CI-CD: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # JDK setting - github actions에서 사용할 JDK 설정 (aws 과 project의 java 버전과 별도로 관리) | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| ## gradle caching (빌드 시간 줄이기) | ||
| - name: Gradle Caching | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
|
|
||
| # dev profile을 활성화 시킵니다. | ||
| - name: Set dev profile | ||
| run: | | ||
| echo "spring: | ||
| profiles: | ||
| include: dev" > ./src/main/resources/application.yml | ||
| shell: bash | ||
|
|
||
| # gradle chmod | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| # gradle build | ||
| - name: Build with Gradle | ||
| run: ./gradlew clean build -x test | ||
|
|
||
| # docker login | ||
| - name: Docker Hub Login | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
|
||
| # docker build & push to develop | ||
| - name: Docker build & push to dev server | ||
| run: | | ||
| docker build -f Dockerfile -t ${{ secrets.DOCKER_REPO }}/eatssu-dev . | ||
| docker push ${{ secrets.DOCKER_REPO }}/eatssu-dev | ||
|
|
||
| ## deploy to develop | ||
| - name: Deploy to dev server | ||
| uses: appleboy/ssh-action@master | ||
| id: deploy-dev | ||
| with: | ||
| host: ${{ secrets.HOST_DEV }} # EC2 퍼블릭 IPv4 DNS | ||
| username: ${{ secrets.USERNAME }} # ubuntu | ||
| port: 22 | ||
| key: ${{ secrets.DEV_PRIVATE_KEY }} | ||
| script: | | ||
| sudo docker ps | ||
| sudo docker rm -f $(docker ps -qa) | ||
| sudo docker pull ${{ secrets.DOCKER_REPO }}/eatssu-dev | ||
| sudo docker run -d -p 9000:9000 \ | ||
| -e EATSSU_DB_URL_DEV="${{ secrets.EATSSU_DB_URL_DEV }}" \ | ||
| -e EATSSU_DB_USERNAME="${{ secrets.EATSSU_DB_USERNAME }}" \ | ||
| -e EATSSU_DB_PASSWORD="${{ secrets.EATSSU_DB_PASSWORD }}" \ | ||
| -e EATSSU_JWT_SECRET_DEV="${{ secrets.EATSSU_JWT_SECRET_DEV }}" \ | ||
| -e EATSSU_AWS_ACCESS_KEY_DEV="${{ secrets.EATSSU_AWS_ACCESS_KEY_DEV }}" \ | ||
| -e EATSSU_AWS_SECRET_KEY_DEV="${{ secrets.EATSSU_AWS_SECRET_KEY_DEV }}" \ | ||
| -e EATSSU_SLACK_TOKEN="${{ secrets.EATSSU_SLACK_TOKEN }}" \ | ||
| ${{ secrets.DOCKER_REPO }}/eatssu-dev | ||
| sudo docker image prune -f | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| ## port number | ||
| server: | ||
| port: 9000 | ||
| env: dev | ||
|
|
||
|
|
||
| spring: | ||
| ## Database | ||
| datasource: | ||
| driver-class-name: com.mysql.cj.jdbc.Driver | ||
| url: ${EATSSU_DB_URL_DEV} | ||
| username: ${EATSSU_DB_USERNAME} | ||
| password: ${EATSSU_DB_PASSWORD} | ||
| hikari: | ||
| maximum-pool-size: 200 | ||
| minimum-idle: 10 | ||
| connection-timeout: 2500 | ||
| connection-init-sql: SELECT 1 | ||
| validation-timeout: 2000 | ||
| idle-timeout: 600000 | ||
| max-lifetime: 1800000 | ||
|
|
||
| ## JPA | ||
| jpa: | ||
| hibernate: | ||
| ddl-auto: none | ||
| properties: | ||
| hibernate: | ||
| jdbc: | ||
| lob: | ||
| non_contextual_creation: true | ||
| format_sql: false | ||
| show_sql: true | ||
|
|
||
| servlet: | ||
| multipart: | ||
| max-file-size: 20MB | ||
| max-request-size: 20MB | ||
|
|
||
| ## Auth | ||
| jwt: | ||
| secret: | ||
| key: ${EATSSU_JWT_SECRET_DEV} | ||
| token-validity-in-seconds: 86400 | ||
| refresh-token-validity-in-seconds: 604800 | ||
|
|
||
| #S3 | ||
| cloud: | ||
| aws: | ||
| credentials: | ||
| accessKey: ${EATSSU_AWS_ACCESS_KEY_DEV} | ||
| secretKey: ${EATSSU_AWS_SECRET_KEY_DEV} | ||
| s3: | ||
| bucket: eatssu-bucket | ||
| region: | ||
| static: ap-northeast-2 | ||
| stack: | ||
| auto: false | ||
|
|
||
| #Slack | ||
| slack: | ||
| token: ${EATSSU_SLACK_TOKEN} | ||
|
|
||
| #Swagger | ||
| swagger: | ||
| url: https://dev.eat-ssu.store | ||
| description: Test Server Swagger API | ||
|
|
||
| springdoc: | ||
| swagger-ui: | ||
| path: /swagger-ui.html | ||
| groups-order: DESC | ||
| operationsSorter: method | ||
| disable-swagger-default-url: true | ||
| display-request-duration: true | ||
| api-docs: | ||
| path: /v3/api-docs | ||
| show-actuator: true | ||
| default-consumes-media-type: application/json | ||
| default-produces-media-type: application/json | ||
| paths-to-match: | ||
| - /** | ||
|
|
||
| logging: | ||
| level: | ||
| root: INFO | ||
| com.zaxxer.hikari: INFO | ||
|
|
||
| management: | ||
| endpoint: | ||
| metrics: | ||
| enabled: true | ||
| prometheus: | ||
| enabled: true | ||
|
|
||
| endpoints: | ||
| web: | ||
| exposure: | ||
| include: health, info, metrics, prometheus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| ## port number | ||
| server: | ||
| port: 9000 | ||
| env: local | ||
|
|
||
|
|
||
| spring: | ||
| ## Database | ||
| datasource: | ||
| driver-class-name: com.mysql.cj.jdbc.Driver | ||
| url: ${EATSSU_DB_URL_DEV} | ||
jayn2u marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| username: ${EATSSU_DB_USERNAME} | ||
| password: ${EATSSU_DB_PASSWORD} | ||
|
|
||
| ## JPA | ||
| jpa: | ||
| hibernate: | ||
| ddl-auto: none | ||
| properties: | ||
| hibernate: | ||
| jdbc: | ||
| lob: | ||
| non_contextual_creation: true | ||
| format_sql: true | ||
| show_sql: false | ||
|
|
||
| servlet: | ||
| multipart: | ||
| max-file-size: 20MB | ||
| max-request-size: 20MB | ||
|
|
||
| ## Auth | ||
| jwt: | ||
| secret: | ||
| key: ${EATSSU_JWT_SECRET_LOCAL} | ||
| token-validity-in-seconds: 86400 | ||
| refresh-token-validity-in-seconds: 259200 | ||
|
|
||
| #S3 | ||
| cloud: | ||
| aws: | ||
| credentials: | ||
| accessKey: ${EATSSU_AWS_ACCESS_KEY_DEV} | ||
| secretKey: ${EATSSU_AWS_SECRET_KEY_DEV} | ||
| s3: | ||
| bucket: eatssu-bucket | ||
| region: | ||
| static: ap-northeast-2 | ||
| stack: | ||
| auto: false | ||
|
|
||
| #Slack | ||
| slack: | ||
| token: ${EATSSU_SLACK_TOKEN} | ||
|
|
||
| #Swagger | ||
| swagger: | ||
| url: http://localhost:9000 | ||
| description: Test Server Swagger API | ||
|
|
||
| springdoc: | ||
| swagger-ui: | ||
| # Swagger UI | ||
| path: /swagger-ui.html | ||
| # Group | ||
| groups-order: DESC | ||
| # API | ||
| operationsSorter: method | ||
| # Swagger UI | ||
| disable-swagger-default-url: true | ||
| # API | ||
| display-request-duration: true | ||
| api-docs: | ||
| path: /v3/api-docs | ||
| show-actuator: true | ||
| default-consumes-media-type: application/json | ||
| default-produces-media-type: application/json | ||
| paths-to-match: | ||
| - /** | ||
|
|
||
| logging: | ||
| level: | ||
| root: INFO | ||
| com.zaxxer.hikari: INFO | ||
|
|
||
| management: | ||
| endpoint: | ||
| metrics: | ||
| enabled: true | ||
| prometheus: | ||
| enabled: true | ||
|
|
||
| endpoints: | ||
| web: | ||
| exposure: | ||
| include: health, info, metrics, prometheus | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.