-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from TEAMMatchDev/feature/issue-104
[Refactor] Redis - PROD, DEV 서버 통일
- Loading branch information
Showing
13 changed files
with
89 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -3,8 +3,6 @@ name: Match batch Server CI/CD | |
on: | ||
push: | ||
branches: [batch] | ||
#tags: | ||
# - Dev-Api-v*.*.* | ||
workflow_dispatch: # 수동 실행 옵션 (생략) | ||
|
||
jobs: | ||
|
@@ -21,48 +19,78 @@ jobs: | |
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
- name: Set Environment - Common Yml | ||
- name: Set Environment - Common Prod Yml | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: ./Match-Common/src/main/resources/application-common.yml | ||
env: | ||
oauth.kakao.base-url: ${{ secrets.KAKAO_BASE_URL }} | ||
oauth.kakao.base-url: ${{ secrets.KAKAO_PROD_BASE_URL }} | ||
oauth.kakao.client-id: ${{ secrets.KAKAO_CLIENT }} | ||
oauth.kakao.client-secret: ${{ secrets.KAKAO_SECRET }} | ||
oauth.kakao.redirect-url: ${{ secrets.KAKAO_REDIRECT }} | ||
oauth.kakao.redirect-url: ${{ secrets.KAKAO_PROD_REDIRECT }} | ||
oauth.kakao.app-id: ${{ secrets.KAKAO_APP_ID }} | ||
oauth.kakao.admin-key: ${{ secrets.KAKAO_ADMIN_KEY }} | ||
jwt.secret: ${{ secrets.JWT_SECRET_KEY }} | ||
jwt.refresh: ${{ secrets.JWT_REFRESH_KEY }} | ||
oauth.naver.secret: ${{ secrets.NAVER_SECRET }} | ||
oauth.naver.client: ${{ secrets.NAVER_CLIENT }} | ||
oauth.naver.redirect-url: ${{ secrets.NAVER_REDIRECT}} | ||
oauth.naver.redirect-url: ${{ secrets.NAVER_PROD_REDIRECT}} | ||
sms.secret: ${{ secrets.SMS_SECRET_KEY }} | ||
sms.api: ${{ secrets.SMS_API_KEY }} | ||
sms.sender: ${{ secrets.SMS_SENDER }} | ||
nice.secret: ${{ secrets.NICE_SECRET_KEY}} | ||
nice.client: ${{ secrets.NICE_CLIENT_KEY }} | ||
nice.url: ${{ secrets.NICE_DEV_URL}} | ||
nice.secret: ${{ secrets.NICE_PROD_SECRET_KEY}} | ||
nice.client: ${{ secrets.NICE_PROD_CLIENT_KEY }} | ||
nice.url: ${{ secrets.NICE_PROD_URL}} | ||
aws.access-key: ${{ secrets.AWS_S3_ACCESS_KEY }} | ||
aws.secret-key: ${{ secrets.AWS_S3_SECRET_KEY }} | ||
aws.s3.bucket: ${{ secrets.AWS_S3_BUCKET }} | ||
aws.s3.bucket-url: ${{ secrets.AWS_S3_BASE_URL }} | ||
discord.webhook.error: ${{ secrets.DISCORD_WEBHOOK_ERROR}} | ||
discord.webhook.alert: ${{ secrets.DISCORD_WEBHOOK_ALERT }} | ||
web.return.url: ${{ secrets.PROD_RETURN_URL }} | ||
match.aligo.url: ${ secrets.MATCH_ALIGO_URL }} | ||
server.host: ${{ secrets.PROD_SERVER_HOST}} | ||
spring.password: ${{ secrets.APP_PASSWORD}} | ||
aligo.username: ${{ secrets.ALIGO_USERNAME }} | ||
aligo.key: ${{ secrets.ALIGO_KEY }} | ||
portone.code: ${{ secrets.PORTONE_CODE }} | ||
portone.key: ${{ secrets.PORTONE_KEY }} | ||
portone.secret: ${{ secrets.PORTONE_SECRET }} | ||
portone.billmid: ${{ secrets.PROD_PORTONE_BILL_MID}} | ||
|
||
|
||
- name: Set Environment Domain - Domain DEV Yml | ||
|
||
- name: Set Environment Domain - Domain Prod Yml | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: ./Match-Domain/src/main/resources/application-domain-dev.yml | ||
files: ./Match-Domain/src/main/resources/application-domain-prod.yml | ||
env: | ||
spring.datasource.url: ${{ secrets.DB_URL_HOST }} | ||
spring.datasource.username: ${{ secrets.AWS_DB_USER_NAME }} | ||
spring.datasource.password: ${{ secrets.AWS_DB_PASSWORD }} | ||
spring.redis.host : ${{ secrets.REDIS_DEV_HOST }} | ||
spring.datasource.master.hikari.jdbc-url: ${{ secrets.PROD_DB_URL_HOST }} | ||
spring.datasource.master.hikari.username: ${{ secrets.AWS_DB_USER_NAME }} | ||
spring.datasource.master.hikari.password: ${{ secrets.AWS_DB_PASSWORD }} | ||
spring.datasource.slave.hikari.jdbc-url: ${{ secrets.PROD_SLAVE_URL_HOST }} | ||
spring.datasource.slave.hikari.username: ${{ secrets.AWS_DB_USER_NAME }} | ||
spring.datasource.slave.hikari.password: ${{ secrets.AWS_DB_PASSWORD }} | ||
spring.redis.host : ${{ secrets.REDIS_PROD_HOST }} | ||
|
||
- name: create-fcm-json | ||
id: create-fcm-json | ||
uses: jsdaniell/[email protected] | ||
with: | ||
name: "serviceAccountKey.json" | ||
json: ${{ secrets.FCM_JSON }} | ||
dir: "Match-Common/src/main/resources/" | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
shell: bash | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew Match-Batch:bootJar | ||
shell: bash | ||
|
@@ -74,23 +102,18 @@ jobs: | |
format: YYYYMMDDTHHmm | ||
utcOffset: "+09:00" | ||
|
||
- name: Generate deployment package | ||
run: | | ||
mkdir -p deploy | ||
cp Match-Batch/build/libs/*.jar deploy/match-batch.jar | ||
cp Procfile deploy/Procfile | ||
cp -r .ebextensions-dev deploy/.ebextensions | ||
cp -r .platform deploy/.platform | ||
cd deploy && zip -r match-batch-${{steps.current-time.outputs.formattedTime}}-${{github.sha}} . | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKER_REPO }}/match_batch_image:latest | ||
|
||
- name: Deploy Consumer to EB | ||
uses: einaregilsson/beanstalk-deploy@v19 | ||
- name: trigger jenkins job. | ||
uses: appleboy/jenkins-action@master | ||
with: | ||
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
application_name: match-batch | ||
environment_name: Match-batch-env | ||
version_label: match-batch-${{steps.current-time.outputs.formattedTime}}-${{github.sha}} | ||
region: ap-northeast-2 | ||
deployment_package: deploy/match-batch-${{steps.current-time.outputs.formattedTime}}-${{github.sha}}.zip | ||
wait_for_deployment: false | ||
url: ${{ secrets.WEBHOOK_URL }} | ||
user: "matchadmin" | ||
token: ${{ secrets.JENKINS_API_TOKEN }} | ||
job: "match-batch" |
This file contains 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 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
FROM openjdk:11-jdk-slim | ||
ADD /Match-Aligo/build/libs/*.jar app.jar | ||
RUN apk add tzdata && ln -snf /usr/share/zoneinfo/Asia/Seoul /etc/localtime | ||
ADD /Match-Batch/build/libs/*.jar app.jar | ||
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=prod", "/app.jar"] |
This file contains 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 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 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 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 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 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 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 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 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 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