Skip to content

Commit 9eba2cd

Browse files
authored
Merge pull request #38 from YAPP-Github/develop
[Ci] (프로덕션) 기획 변경으로 인한 인프라 변경점 적용
2 parents af3bd21 + 9bb01e9 commit 9eba2cd

File tree

115 files changed

+3259
-327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3259
-327
lines changed

.coderabbit.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: "ko-KR"
2+
early_access: false
3+
reviews:
4+
profile: "chill"
5+
request_changes_workflow: false
6+
high_level_summary: true
7+
poem: true
8+
review_status: true
9+
collapse_walkthrough: false
10+
auto_review:
11+
enabled: true
12+
drafts: false
13+
base_branches:
14+
- "main"
15+
- "develop"
16+
chat:
17+
auto_reply: true
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
fix:
2-
- head-branch: ['^fix/', '^bugfix/']
2+
- head-branch: [ '^fix/', '^bugfix/' ]
33

44
hotfix:
5-
- head-branch: ['^hotfix/']
5+
- head-branch: [ '^hotfix/' ]
66

77
feat:
8-
- head-branch: ['^feat/', '^feature/']
8+
- head-branch: [ '^feat/', '^feature/' ]
99

1010
docs:
11-
- head-branch: ['^docs/']
11+
- head-branch: [ '^docs/' ]
1212

1313
refactor:
14-
- head-branch: ['^refactor/']
14+
- head-branch: [ '^refactor/' ]
1515

1616
test:
17-
- head-branch: ['^test/']
17+
- head-branch: [ '^test/' ]
1818

1919
chore:
20-
- head-branch: ['^chore/']
20+
- head-branch: [ '^chore/' ]
2121

2222
ci:
23-
- head-branch: ['^ci/']
23+
- head-branch: [ '^ci/' ]
2424

2525
build:
26-
- head-branch: ['^build/']
26+
- head-branch: [ '^build/' ]
2727

2828
perf:
29-
- head-branch: ['^perf/']
29+
- head-branch: [ '^perf/' ]
3030

3131
revert:
32-
- head-branch: ['^revert/']
32+
- head-branch: [ '^revert/' ]

.github/workflows/auto-assign.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Auto Assign
22

33
on:
44
pull_request:
5-
types: [opened, ready_for_review]
5+
types: [ opened, ready_for_review ]
66

77
jobs:
88
add-reviews:

.github/workflows/auto-label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Auto Label PRs
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
5+
types: [ opened, synchronize, reopened ]
66

77
jobs:
88
label:
@@ -11,4 +11,4 @@ jobs:
1111
- uses: actions/labeler@v5
1212
with:
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}
14-
configuration-path: '.github/config/pr-labeler-config.yml'
14+
configuration-path: '.github/config/pr-labeler-config.yml'

.github/workflows/close-jira-issue.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ jobs:
2929
uses: atlassian/gajira-transition@v3
3030
with:
3131
issue: ${{ env.JIRA_KEY }}
32+
transition: 완료

.github/workflows/deploy-dev.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
echo "ECS_CLUSTER=$(echo "$TF_OUTPUTS" | jq -r '.ecs_cluster_name.value')" >> $GITHUB_ENV
9696
echo "ECS_SERVICE=$(echo "$TF_OUTPUTS" | jq -r '.ecs_api_service_name.value')" >> $GITHUB_ENV
9797
echo "CONTAINER_NAME=$(echo "$TF_OUTPUTS" | jq -r '.ecs_api_container_name.value')" >> $GITHUB_ENV
98+
echo "PRIVATE_IP=$(echo "$TF_OUTPUTS" | jq -r '.ec2_private_ip.value')" >> $GITHUB_ENV
9899
99100
- name: Configure AWS credentials
100101
uses: aws-actions/configure-aws-credentials@v4
@@ -103,13 +104,29 @@ jobs:
103104
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
104105
aws-region: ${{ env.AWS_REGION }}
105106

107+
- name: Update MYSQL_URL in Parameter Store
108+
run: |
109+
MYSQL_URL="jdbc:mysql://${PRIVATE_IP}:3306/eatda?useUnicode=true&characterEncoding=UTF-8"
110+
111+
aws ssm put-parameter \
112+
--name "/dev/MYSQL_URL" \
113+
--type "SecureString" \
114+
--value "$MYSQL_URL" \
115+
--overwrite
116+
106117
- name: Set up Node.js
107118
uses: actions/setup-node@v4
108119
with:
109120
node-version: '22'
110121

111122
- name: Install Semantic Release dependencies
112-
run: npm install semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator conventional-changelog-conventionalcommits
123+
run: |
124+
npm install \
125+
semantic-release \
126+
@semantic-release/commit-analyzer \
127+
@semantic-release/release-notes-generator \
128+
@semantic-release/github \
129+
conventional-changelog-conventionalcommits
113130
114131
- name: Semantic Release
115132
id: get_version
@@ -134,11 +151,24 @@ jobs:
134151
architecture: 'x64'
135152
cache: 'gradle'
136153

154+
- name: Get TEST_JWT_SECRET_KEY from SSM
155+
id: get-test-secret
156+
run: |
157+
SECRET_VALUE=$(aws ssm get-parameter \
158+
--name "/common/TEST_JWT_SECRET_KEY" \
159+
--with-decryption \
160+
--region "${{ env.AWS_REGION }}" \
161+
--query "Parameter.Value" \
162+
--output text)
163+
echo "TEST_JWT_SECRET_KEY=$SECRET_VALUE" >> $GITHUB_ENV
164+
137165
- name: Build with Gradle
138166
run: |
139167
cd ${{ github.workspace }}
140168
chmod +x gradlew
141-
./gradlew clean build
169+
./gradlew clean build -Dspring.profiles.active=dev
170+
env:
171+
TEST_JWT_SECRET_KEY: ${{ env.TEST_JWT_SECRET_KEY }}
142172

143173
- name: Login to Amazon ECR
144174
id: login-ecr
@@ -169,7 +199,7 @@ jobs:
169199
image: ${{ env.image }}
170200

171201
- name: Deploy Amazon ECS task definition
172-
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
202+
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
173203
with:
174204
task-definition: ${{ steps.task-def.outputs.task-definition }}
175205
service: ${{ env.ECS_SERVICE }}
@@ -208,4 +238,4 @@ jobs:
208238
**시도 버전**: ${{ env.SEMANTIC_VERSION }}
209239
**커밋**: [${{ steps.vars.outputs.sha_short }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
210240
**요청자**: ${{ github.actor }}
211-
embed-url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
241+
embed-url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

.github/workflows/deploy-prod.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,30 @@ jobs:
9696
fetch-depth: 0
9797
fetch-tags: true
9898

99-
- name: Parse Terraform Outputs and Set Environment Variables
99+
- name: Configure AWS credentials
100+
uses: aws-actions/configure-aws-credentials@v4
101+
with:
102+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
103+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
104+
aws-region: ${{ env.AWS_REGION }}
105+
106+
- name: Parse Terraform Outputs
107+
id: parse-tf
100108
run: |
101109
TF_OUTPUTS='${{ needs.terraform-apply-prod.outputs.tf_outputs_json }}'
102110
echo "ECR_REPOSITORY=$(echo "$TF_OUTPUTS" | jq -r '.ecr_repository_name.value')" >> $GITHUB_ENV
103111
echo "ECS_CLUSTER=$(echo "$TF_OUTPUTS" | jq -r '.ecs_cluster_name.value')" >> $GITHUB_ENV
104112
echo "ECS_SERVICE=$(echo "$TF_OUTPUTS" | jq -r '.ecs_api_service_name.value')" >> $GITHUB_ENV
105113
echo "CONTAINER_NAME=$(echo "$TF_OUTPUTS" | jq -r '.ecs_api_container_name.value')" >> $GITHUB_ENV
114+
echo "RDS_ENDPOINT=$(echo "$TF_OUTPUTS" | jq -r '.rds_endpoint.value')" >> $GITHUB_ENV
106115
107-
- name: Configure AWS credentials
108-
uses: aws-actions/configure-aws-credentials@v4
109-
with:
110-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
111-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
112-
aws-region: ${{ env.AWS_REGION }}
116+
- name: Update DB URL in Parameter Store
117+
run: |
118+
aws ssm put-parameter \
119+
--name "/prod/mysql-url" \
120+
--value "jdbc:mysql://${{ env.RDS_ENDPOINT }}:3306/eatda?useUnicode=true&characterEncoding=UTF-8" \
121+
--type SecureString \
122+
--overwrite
113123
114124
- name: Set up Node.js
115125
uses: actions/setup-node@v4
@@ -153,11 +163,24 @@ jobs:
153163
architecture: 'x64'
154164
cache: 'gradle'
155165

166+
- name: Get TEST_JWT_SECRET_KEY from SSM
167+
id: get-test-secret
168+
run: |
169+
SECRET_VALUE=$(aws ssm get-parameter \
170+
--name "/common/TEST_JWT_SECRET_KEY" \
171+
--with-decryption \
172+
--region "${{ env.AWS_REGION }}" \
173+
--query "Parameter.Value" \
174+
--output text)
175+
echo "TEST_JWT_SECRET_KEY=$SECRET_VALUE" >> $GITHUB_ENV
176+
156177
- name: Build with Gradle
157178
run: |
158179
cd ${{ github.workspace }}
159180
chmod +x gradlew
160-
./gradlew clean build
181+
./gradlew clean build -Dspring.profiles.active=prod
182+
env:
183+
TEST_JWT_SECRET_KEY: ${{ env.TEST_JWT_SECRET_KEY }}
161184

162185
- name: Login to Amazon ECR
163186
id: login-ecr

.github/workflows/sonarcloud.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request:
88
branches:
99
- main
10+
env:
11+
AWS_REGION: ap-northeast-2
12+
1013
jobs:
1114
test:
1215
runs-on: ubuntu-latest
@@ -21,6 +24,24 @@ jobs:
2124
java-version: 21
2225
distribution: 'temurin'
2326

27+
- name: Configure AWS credentials
28+
uses: aws-actions/configure-aws-credentials@v4
29+
with:
30+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
31+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
32+
aws-region: ${{ env.AWS_REGION }}
33+
34+
- name: Get TEST_JWT_SECRET_KEY from SSM
35+
id: get-test-secret
36+
run: |
37+
SECRET_VALUE=$(aws ssm get-parameter \
38+
--name "/common/TEST_JWT_SECRET_KEY" \
39+
--with-decryption \
40+
--region "${{ env.AWS_REGION }}" \
41+
--query "Parameter.Value" \
42+
--output text)
43+
echo "TEST_JWT_SECRET_KEY=$SECRET_VALUE" >> $GITHUB_ENV
44+
2445
- name: Grant execute permission for gradlew
2546
run: chmod +x ./gradlew
2647

@@ -35,4 +56,5 @@ jobs:
3556
env:
3657
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3758
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38-
run: ./gradlew test jacocoTestReport sonar --info
59+
TEST_JWT_SECRET_KEY: ${{ env.TEST_JWT_SECRET_KEY }}
60+
run: ./gradlew test jacocoTestReport sonar --info

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ build/
44
!gradle/wrapper/gradle-wrapper.jar
55
!**/src/main/**/build/
66
!**/src/test/**/build/
7+
.env-local
8+
.env.local
79

810
### STS ###
911
.apt_generated
@@ -42,4 +44,4 @@ out/
4244
### terraform ###
4345
.terraform/
4446
*.tfstate
45-
*.tfstate.*
47+
*.tfstate.*

.releaserc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030
"preset": "conventionalcommits"
3131
}
3232
],
33-
"@semantic-release/changelog",
34-
"@semantic-release/github",
35-
[
36-
"@semantic-release/git", {
37-
"assets": ["CHANGELOG.md"],
38-
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
39-
}
40-
]
33+
"@semantic-release/github"
4134
]
4235
}

0 commit comments

Comments
 (0)