Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
3eebdc3
[Refactor] ์•Œ๋ฆผ์ƒ์„ฑ๋กœ์ง ๊ด€๋ จ ์ค‘๋ณต ์ฝ”๋“œ ๊ฐœ์„ 
sss4920 Oct 29, 2023
08da36f
Merge pull request #182 from team-winey/refactor/#181
sss4920 Oct 30, 2023
bc0484a
[Feat] fcm ๊ด€๋ จ ๋กœ์ง ๊ตฌํ˜„ (#187)
sss4920 Nov 17, 2023
75689d3
Update cd.yml
funnysunny08 Nov 17, 2023
f922e3e
Update gradle.yml
funnysunny08 Nov 17, 2023
fe3ab87
Revert "[Feat] fcm ๊ด€๋ จ ๋กœ์ง ๊ตฌํ˜„ (#187)"
funnysunny08 Nov 17, 2023
8877d0f
Update cd.yml
funnysunny08 Nov 17, 2023
af0543b
Update gradle.yml
funnysunny08 Nov 17, 2023
b115b91
[Fix] ๋ฐฐํฌ ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•œ๋‹ค. (#193)
funnysunny08 Nov 17, 2023
daa6acb
Update cd.yml
funnysunny08 Nov 17, 2023
db11906
Update gradle.yml
funnysunny08 Nov 17, 2023
c110252
Merge branch 'main' into dev
funnysunny08 Nov 17, 2023
a72ef3f
Update appspec.yml
funnysunny08 Nov 17, 2023
f313fd5
feat: getFCMToken ๋ฉ”์„œ๋“œ๋ฅผ ์˜ค๋ฒ„๋ผ์ด๋“œํ•œ๋‹ค. (#196)
funnysunny08 Nov 17, 2023
c6b2a5a
[Fix] fcm ํŽ˜์ด๋กœ๋“œ ์ˆ˜์ •
sss4920 Dec 3, 2023
7955405
[Fix] fcmtoken response์—์„œ ์ œ์™ธ
sss4920 Dec 3, 2023
d43e192
Merge remote-tracking branch 'origin/dev' into fix/#198
funnysunny08 Dec 3, 2023
c90ab4d
Merge pull request #199 from team-winey/fix/#198
sss4920 Dec 3, 2023
5409c08
Merge pull request #200 from team-winey/dev
sss4920 Dec 3, 2023
42fd948
[Fix]๋Œ“๊ธ€์•Œ๋ฆผ ๋ฒ„๊ทธ ์ˆ˜์ •
sss4920 Dec 5, 2023
df439d2
Merge pull request #202 from team-winey/refactor/#201
sss4920 Dec 6, 2023
e3aca1d
Merge pull request #203 from team-winey/dev
sss4920 Dec 6, 2023
2fb7f14
[Refactor] ์•„์š” ํ…Œ์ŠคํŠธ ์™„๋ฃŒ ์•ˆ๋“œ ํ…Œ์ŠคํŠธ ์ „
sss4920 Dec 8, 2023
fe18b74
Merge pull request #205 from team-winey/refactor/#204
sss4920 Dec 9, 2023
1f2d969
Update deploy.sh
sss4920 Dec 9, 2023
bf7d56a
Update deploy.sh
funnysunny08 Dec 11, 2023
9406593
Create dev-ci.yml
funnysunny08 Dec 11, 2023
5797c1c
Create dev-cd.yml
funnysunny08 Dec 11, 2023
2a036cb
Update dev-ci.yml
funnysunny08 Dec 11, 2023
1972957
Update dev-cd.yml
funnysunny08 Dec 11, 2023
99708db
Update dev-ci.yml
funnysunny08 Dec 11, 2023
0bd7800
Update dev-cd.yml
funnysunny08 Dec 11, 2023
4b6fec4
Update dev-ci.yml
funnysunny08 Dec 11, 2023
6ef0dbc
Update dev-ci.yml
funnysunny08 Dec 11, 2023
f3e9a57
Update dev-ci.yml
funnysunny08 Dec 11, 2023
be94ae1
[Feat] ๋ชฉํ‘œ ์ณฌ๊ณ„ ๊ฐœํŽธ (#214)
funnysunny08 Jan 9, 2024
3b59eba
.gitignore์— application.yml ์ถ”๊ฐ€
alpha-kwhn Jan 9, 2024
f6a0d17
FeedType enum ์ƒ์„ฑ
alpha-kwhn Jan 9, 2024
2421777
Feed ์—”ํ‹ฐํ‹ฐ์— FeedType ์ปฌ๋Ÿผ ์ถ”๊ฐ€
alpha-kwhn Jan 9, 2024
3db9907
ํ”ผ๋“œ์ƒ์„ฑ์š”์ฒญ Dto์— default๊ฐ’์ด null์ธ feedType ์ถ”๊ฐ€ ๋ฐ feedType setter ์ƒ์„ฑ
alpha-kwhn Jan 9, 2024
36abf6c
์ž˜๋ชป๋œ feedType ์œ ํ˜•์˜ ๊ฐ’์ด requestDto๋กœ ์ „๋‹ฌ๋˜์—ˆ์„๋•Œ ์‘๋‹ตํ•˜๋Š” ์ปค์Šคํ…€ 400์—๋Ÿฌ ์ถ”๊ฐ€
alpha-kwhn Jan 9, 2024
9bb431b
ํ”ผ๋“œ ๊ฐœ์ˆ˜ ์ฆ๊ฐ€, ์ ˆ์•ฝ ๊ธˆ์•ก ์ฆ๊ฐ€ ๊ธฐ๋Šฅ์ด ๋ณ„๋„๋กœ ๋™์ž‘ํ•˜๊ฒŒ๋” ํ•จ์ˆ˜ ๋ถ„๋ฆฌ
alpha-kwhn Jan 9, 2024
08f228f
feedType ๊ฐ’์„ ๊ณ ๋ คํ•˜์—ฌ ํ”ผ๋“œ๊ฐ€ ์ƒ์„ฑ๋˜๊ณ , ์ ˆ์•ฝ ์•ก์ˆ˜๊ฐ€ ์กฐ๊ฑด์ ์œผ๋กœ ์ฆ๊ฐ€ํ•˜๊ฒŒ๋” ํ”ผ๋“œ์ƒ์„ฑ ๋น„์ฆˆ๋‹ˆ์Šค๋กœ์ง ์ˆ˜์ •
alpha-kwhn Jan 9, 2024
c8468d7
ํ”ผ๋“œ์กฐํšŒ response dto์— feedType๊ฐ’๋„ ์ถ”๊ฐ€๋˜๊ฒŒ๋” ์ˆ˜์ •
alpha-kwhn Jan 9, 2024
5c5d37a
ํ”ผ๋“œ์กฐํšŒ response dto์— feedType๊ฐ’๋„ ์ถ”๊ฐ€๋˜๊ฒŒ๋” service ๊ณ„์ธต ๋กœ์ง ์ˆ˜์ • ๋ฐ ํ”ผ๋“œ์ƒ์„ฑ์‹œ feedTypeโ€ฆ
alpha-kwhn Jan 9, 2024
dd7ae80
ํ”ผ๋“œ์‚ญ์ œ์‹œ์— ๋ˆ„์ ํ”ผ๋“œ๊ฐœ์ˆ˜, ๋ˆ„์ ์ ˆ์•ฝ๊ธˆ์•ก ๊ฐ์†Œ๊ฐ€ ๋ณ„๋„๋กœ ๋ฐœ์ƒํ•˜๊ฒŒ๋” ํ•จ์ˆ˜ ๋ถ„๋ฆฌ
alpha-kwhn Jan 9, 2024
1b375ba
์ ˆ์•ฝํ”ผ๋“œ ์‚ญ์ œ์‹œ์—๋งŒ ๋ˆ„์ ์ ˆ์•ฝ๊ธˆ์•ก ๊ฐ์†Œํ•˜๋„๋ก ๋กœ์ง์ˆ˜์ •
alpha-kwhn Jan 9, 2024
becd795
๋ˆ„์  ํ”ผ๋“œ๊ฐœ์ˆ˜, ์ ˆ์•ฝ๊ธˆ์•ก ํ•จ๊ป˜ ์ฆ๊ฐํ•˜๋„๋ก ํ•จ์ˆ˜ ๋ณ€๊ฒฝ
alpha-kwhn Jan 10, 2024
728baa7
์ ˆ์•ฝํ”ผ๋“œ ์ƒ์„ฑ,์‚ญ์ œ์˜ ๊ฒฝ์šฐ์—๋งŒ ์ผ๊ด„์ ์œผ๋กœ ์ ˆ์•ฝํ”ผ๋“œ๊ฐœ์ˆ˜, ์ ˆ์•ฝ๋ˆ„์ ๊ธˆ์•ก ์ฆ๊ฐํ•˜๋„๋ก ์ˆ˜์ •
alpha-kwhn Jan 10, 2024
a5e78d3
Merge pull request #215 from team-winey/feat/#210
alpha-kwhn Jan 11, 2024
b7a7467
[Feat] ๋งˆ์ดํŽ˜์ด์ง€ ๊ฐœํŽธ (#217)
funnysunny08 Jan 12, 2024
f3d912a
[Feat] ๋ ˆ๋ฒจ ๋‹ฌ์„ฑ ํ˜„ํ™ฉ API (#219)
funnysunny08 Jan 23, 2024
72d87aa
[Feat] ๋งˆ์ดํŽ˜์ด์ง€ ์‘๋‹ต๊ฐ’ ์ถ”๊ฐ€ (#221)
funnysunny08 Jan 28, 2024
9bf6fa8
[Fix] ๋ ˆ๋ฒจ์—… ์กฐ๊ฑด ๋ณ€๊ฒฝ (#223)
funnysunny08 Jan 29, 2024
e69f26a
[Fix] ๋งˆ์ดํŽ˜์ด์ง€ API ๊ตฌ์กฐ ๋ณ€๊ฒฝ
alpha-kwhn Feb 4, 2024
372d22c
Merge pull request #225 from team-winey/fix/#224
alpha-kwhn Feb 5, 2024
8fd3a04
Update dev-cd.yml
alpha-kwhn Feb 5, 2024
d5e1779
Update dev-cd.yml
alpha-kwhn Feb 5, 2024
a7e98f7
Update dev-cd.yml
sss4920 Feb 5, 2024
fca775b
Update dev-cd.yml
alpha-kwhn Feb 5, 2024
f11d9b3
Update dev-cd.yml
alpha-kwhn Feb 5, 2024
c5e46ea
Update dev-cd.yml
alpha-kwhn Feb 5, 2024
8940c92
Update dev-ci.yml
sss4920 Feb 5, 2024
49ad544
Update dev-cd.yml
alpha-kwhn Feb 5, 2024
8e717e4
[Chore] ์žฌmerge ํ…Œ์ŠคํŠธ
alpha-kwhn Feb 5, 2024
546a328
Update dev-ci.yml
alpha-kwhn Feb 5, 2024
cb1c388
Update dev-ci.yml
alpha-kwhn Feb 5, 2024
cc0f2c8
[Fix] ํ…Œ์ŠคํŠธ์ฝ”๋“œ ์˜ค๋ฅ˜ ์ฃผ์„์ฒ˜๋ฆฌ
alpha-kwhn Feb 5, 2024
47a4fab
Merge remote-tracking branch 'origin/fix/cd' into fix/cd
alpha-kwhn Feb 5, 2024
6dcdb24
Merge pull request #226 from team-winey/fix/cd
alpha-kwhn Feb 5, 2024
a86ea52
Merge branch 'fix/cd' into fix/#224
alpha-kwhn Feb 5, 2024
b858121
Merge branch 'fix/#224' into feat/#224-2
alpha-kwhn Feb 5, 2024
36e924c
Update deploy.sh
sss4920 Feb 5, 2024
8d3be21
Merge branch 'dev' into feat/#224-2
alpha-kwhn Feb 5, 2024
b307e9c
Merge pull request #227 from team-winey/feat/#224-2
alpha-kwhn Feb 5, 2024
e46cc3c
[Feat] ๋ˆ„์  ์œ„๋‹ˆ null์ผ ๊ฒฝ์šฐ 0 ๋ฐ˜ํ™˜ (#229)
funnysunny08 Feb 16, 2024
32b916c
[Refactor] user ํŽ˜์ด์ง€์— ๋‚จ์€ ๊ธˆ์•ก ๋‚จ์€ ํšŸ์ˆ˜ ์ถ”๊ฐ€
sss4920 Feb 21, 2024
45ec08e
Merge pull request #231 from team-winey/refactor/#230
sss4920 Feb 22, 2024
403d971
[Refactor]#232 ์ ˆ์•ฝ ๋ˆ„์ ํšŸ์ˆ˜ ์ถ”๊ฐ€
sss4920 Feb 22, 2024
c29a4f5
Merge pull request #233 from team-winey/refactor/#232
sss4920 Feb 22, 2024
0c90e6a
[Fix] ํ”ผ๋“œ์ƒ์„ฑ์‹œ ๋ ˆ๋ฒจ์—… ๋‹ฌ์„ฑ์—ฌ๋ถ€ bool ๊ฐ’ responseBody์— ๋‹ด๊ฒŒ๋” ์ˆ˜์ •
alpha-kwhn Feb 23, 2024
4f65482
Merge pull request #235 from team-winey/fix/#234
alpha-kwhn Feb 24, 2024
5671cd1
[Refactor]#236 ์ฒซ๋กœ๊ทธ์ธ ๋ฉ”์‹œ์ง€ ๋ณ€๊ฒฝ
sss4920 Mar 2, 2024
e8a16ce
Merge pull request #237 from team-winey/refactor/#236
sss4920 Mar 2, 2024
295a5ab
[Feat]#238 feature: ์ „์ฒด ํ‘ธ์‹œ์•Œ๋ฆผ๋ฉ”์‹œ์ง€ ๋ฐœ์†ก
sss4920 Mar 6, 2024
a7af2f6
[Feature]#238: try catch ๋ฌธ ์ˆ˜์ •
sss4920 Mar 13, 2024
d143603
Merge pull request #239 from team-winey/feature/#238
sss4920 Mar 13, 2024
233eea0
[Feat] ํ† ํฐ ๋งŒ๋ฃŒ์‹œ๊ฐ„ ๋ณ€๊ฒฝ (#243)
funnysunny08 May 8, 2024
2067395
[Feat] ํ† ํฐ ๋งŒ๋ฃŒ์‹œ๊ฐ„ ๋ณ€๊ฒฝ (#245)
funnysunny08 May 8, 2024
5c0b1eb
[Feat] ๋งˆ์ดํŽ˜์ด์ง€ ์‘๋‹ต๊ฐ’ ๋ณ€๊ฒฝ (#247)
funnysunny08 May 13, 2024
b1406aa
[Test] ์†Œ์…œ ๋กœ๊ทธ์ธ ๋กœ๊ทธ (#250)
funnysunny08 May 18, 2024
4cad991
[Fix/#248] kakao ์—ฐ๊ฒฐ๋Š๊ธฐ ์–ด๋“œ๋ฏผํ‚ค ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„
sss4920 May 18, 2024
a427211
[Feat] ๋ชฉํ‘œ ์ฒด๊ณ„ ์ œ๊ฑฐ (#252)
funnysunny08 May 18, 2024
c2fb848
[Fix/#248] ์นด์นด์˜ค ์—ฐ๊ฒฐ๋Š๊ธฐ ๊ตฌํ˜„
sss4920 May 18, 2024
02f8864
hotfix: sshํ„ฐ๋„๋ง ๊ตฌ์„ฑ
sss4920 Feb 6, 2025
cf47b9a
hotfix: profile์ถ”๊ฐ€
sss4920 Feb 6, 2025
e9ecd9f
Update cd.yml
funnysunny08 Feb 9, 2025
e4ce097
Update cd.yml
funnysunny08 Feb 9, 2025
fdc930c
Merge pull request #254 from team-winey/hotfix/ssh
sss4920 Feb 9, 2025
75fc715
Merge pull request #253 from team-winey/fix/#248
sss4920 Feb 9, 2025
aabaabf
Update gradle.yml
sss4920 Feb 9, 2025
80fe170
Update deploy.sh
sss4920 Feb 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/dev-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@

# ์›Œํฌํ”Œ๋กœ์šฐ์˜ ์ด๋ฆ„ ์ง€์ •
name: WINEY-DEV-CD

# ํ•ด๋‹น workflow๊ฐ€ ์–ธ์ œ ์‹คํ–‰๋  ๊ฒƒ์ธ์ง€์— ๋Œ€ํ•œ ํŠธ๋ฆฌ๊ฑฐ๋ฅผ ์ง€์ •
on:
push:
branches: [ dev ] # dev branch๋กœ push ๋  ๋•Œ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค.

env:
S3_BUCKET_NAME: winey-dev

jobs:
build:
name: Code deployment

# ์‹คํ–‰ ํ™˜๊ฒฝ
runs-on: ubuntu-latest

steps:

# 1) ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰ ์ „ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ฒดํฌ์•„์›ƒ ํ•„์š”
- name: checkout
uses: actions/checkout@v3

# 2) JDK 11๋ฒ„์ „ ์„ค์น˜, ๋‹ค๋ฅธ JDK ๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜๋‹ค๋ฉด ์ˆ˜์ •
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

# 3) ํ™˜๊ฒฝ๋ณ€์ˆ˜ ํŒŒ์ผ ์ƒ์„ฑ
- name: make application.properties ํŒŒ์ผ ์ƒ์„ฑ
run: |
## create application.yml
mkdir -p ./src/main/resources

# application.yml ํŒŒ์ผ ์ƒ์„ฑ
touch ./application.yml

# GitHub-Actions ์—์„œ ์„ค์ •ํ•œ ๊ฐ’์„ application.yml ํŒŒ์ผ์— ์“ฐ๊ธฐ
echo "${{ secrets.WINEY_DEV_APPLICATION }}" >> ./application.yaml

# winey-firebase.json ํŒŒ์ผ ์ƒ์„ฑ
touch ./winey-firebase.json

# Firebase secrets ํŒŒ์ผ ๋ณต์‚ฌ
echo "${{ secrets.WINEY_FIREBASE }}" >> ./winey-firebase.json

# application.yml ํŒŒ์ผ ํ™•์ธ
cat ./application.yml
shell: bash

# ์ด ์›Œํฌํ”Œ๋กœ์šฐ๋Š” gradle build
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle # ์‹ค์ œ application build ํ…Œ์ŠคํŠธ ์ œ์™ธ
run: ./gradlew build -x test

# ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ
- name: Make Directory
run: mkdir -p deploy

# Jar ํŒŒ์ผ ๋ณต์‚ฌ
- name: Copy Jar
run: cp ./build/libs/*.jar ./deploy

# appspec.yml ํŒŒ์ผ ๋ณต์‚ฌ
- name: Copy appspec.yml
run: cp appspec.yml ./deploy

# script files ๋ณต์‚ฌ
- name: Copy script
run: cp ./scripts/*.sh ./deploy

- name: Make zip file
run: zip -r ./winey_dev_server.zip ./deploy
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_DEV_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_DEV_SECRET_KEY }}
aws-region: ap-northeast-2

- name: Upload to S3
run: aws s3 cp --region ap-northeast-2 ./winey_dev_server.zip s3://$S3_BUCKET_NAME/

# Deploy
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_DEV_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_DEV_SECRET_KEY }}
run:
aws deploy create-deployment
--application-name winey-dev-codedeploy
--deployment-group-name winey-dev-codedeploy-group
--file-exists-behavior OVERWRITE
--s3-location bucket=winey-dev,bundleType=zip,key=winey_dev_server.zip
--region ap-northeast-2
53 changes: 53 additions & 0 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: WINEY DEV CI

on:
pull_request:
branches: [ "dev" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: make application.properties ํŒŒ์ผ ์ƒ์„ฑ
run: |
## create application.yml
mkdir -p ./src/main/resources

# application.yml ํŒŒ์ผ ์ƒ์„ฑ
touch ./application.yml

# GitHub-Actions ์—์„œ ์„ค์ •ํ•œ ๊ฐ’์„ application.yml ํŒŒ์ผ์— ์“ฐ๊ธฐ
echo "${{ secrets.WINEY_DEV_APPLICATION }}" >> ./application.yml

# Firebase secrets ํŒŒ์ผ ๋ณต์‚ฌ
echo "${{ secrets.WINEY_FIREBASE }}" >> ./winey-firebase.json

# application.yml ํŒŒ์ผ ํ™•์ธ
cat ./application.yml
shell: bash

# ์ด ์›Œํฌํ”Œ๋กœ์šฐ๋Š” gradle build
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle # ์‹ค์ œ application build
run: ./gradlew build -PactiveProfiles=local
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: make application.properties ํŒŒ์ผ ์ƒ์„ฑ
run: |
## create application.yml
cd ./src/main/resources
mkdir -p ./src/main/resources

# application.yml ํŒŒ์ผ ์ƒ์„ฑ
touch ./application.yml
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ out/

### application.yml ###
application.yaml
application.yml

### DS_Store
.DS_Store
Expand Down
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ dependencies {

// JPA & Database
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'mysql:mysql-connector-java:8.0.32'

// implementation 'mysql:mysql-connector-java:8.0.32'
runtimeOnly 'com.mysql:mysql-connector-j'
// S3 AWS
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-aws', version: '2.2.6.RELEASE'

Expand All @@ -58,6 +58,7 @@ dependencies {

//FCM
implementation group: 'com.google.firebase', name: 'firebase-admin', version: '6.8.1'
implementation 'com.squareup.okhttp3:okhttp:4.10.0' // Firebase ์„œ๋ฒ„๋กœ ํ‘ธ์‹œ ๋ฉ”์‹œ์ง€ ์ „์†ก ์‹œ ํ•„์š”

//rabbitmq
implementation 'org.springframework.boot:spring-boot-starter-amqp'
Expand All @@ -66,6 +67,10 @@ dependencies {
// ShedLock
implementation 'net.javacrumbs.shedlock:shedlock-spring:4.14.0'
implementation 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template:4.14.0'

// ssh
implementation 'com.github.mwiede:jsch:0.2.17'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
}

tasks.named('test') {
Expand Down
8 changes: 4 additions & 4 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ if [ -z $IDLE_PID ]
then
echo "> ํ˜„์žฌ ๊ตฌ๋™์ค‘์ธ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์—†์œผ๋ฏ€๋กœ ์ข…๋ฃŒํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค."
else
echo "> kill -15 $IDLE_PID"
kill -15 $IDLE_PID
echo "> kill -9 $IDLE_PID"
kill -9 $IDLE_PID
sleep 20
fi

echo "> $IDLE_PROFILE ๋ฐฐํฌ"
nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=$IDLE_PROFILE $IDLE_APPLICATION_PATH >> /home/ubuntu/app/nohup.out 2>&1 &

echo "> $IDLE_PROFILE 10์ดˆ ํ›„ Health check ์‹œ์ž‘"
echo "> $IDLE_PROFILE 60์ดˆ ํ›„ Health check ์‹œ์ž‘"
echo "> curl -s http://localhost:$IDLE_PORT/health "
sleep 10
sleep 60

for retry_count in {1..10}
do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;
import org.winey.server.domain.notification.Notification;
import org.winey.server.service.FcmService;
import org.winey.server.service.message.FcmRequestDto;

import java.io.*;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;

@Component
@AllArgsConstructor
public class MessageQueueReceiver {
Expand All @@ -24,7 +29,8 @@ public class MessageQueueReceiver {
value = @Queue(name = "like-notification"),
key = "like-noti")
)
public void likeReceiver(byte[] likeNoti){
public void likeReceiver(byte[] likeNoti, Channel channel,@Header(AmqpHeaders.DELIVERY_TAG) long tag) throws
IOException {
System.out.println("์ข‹์•„์š” noti receiver");
ByteArrayInputStream bis = new ByteArrayInputStream(likeNoti);
ObjectInput in = null;
Expand All @@ -34,10 +40,14 @@ public void likeReceiver(byte[] likeNoti){
System.out.println("์—ฌ๊ธฐ๊นŒ์ง„ ์˜ค๋Š”๊ฐ€");
if (obj instanceof FcmRequestDto){
FcmRequestDto notification = (FcmRequestDto) obj;
fcmService.sendByToken(notification);
String response = String.valueOf(fcmService.sendByToken(notification));
if (response.isEmpty()){
throw new IOException();
}
}
}catch (IOException | ClassNotFoundException e){
e.printStackTrace();
channel.basicNack(tag,false,true);
}finally {
try{
bis.close();
Expand All @@ -62,9 +72,12 @@ public void commentReceiver(byte[] commentNoti){
try {
in = new ObjectInputStream(bis);
Object obj = in.readObject();
if (obj instanceof Notification){
if (obj instanceof FcmRequestDto){
FcmRequestDto notification = (FcmRequestDto) obj;
fcmService.sendByToken(notification);
String response = String.valueOf(fcmService.sendByToken(notification));
if (response.isEmpty()){
throw new IOException();
}
}
}catch (IOException | ClassNotFoundException e){
e.printStackTrace();
Expand Down
37 changes: 37 additions & 0 deletions src/main/java/org/winey/server/config/ssh/SshDataSourceConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.winey.server.config.ssh;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;

import javax.sql.DataSource;

@Slf4j
@Profile({"local","set1","set2"})
@Configuration
@RequiredArgsConstructor
public class SshDataSourceConfig {

private final SshTunnelingInitializer initializer;

@Bean("dataSource")
@Primary
public DataSource dataSource(DataSourceProperties properties) {

Integer forwardedPort = initializer.buildSshConnection(); // ssh ์—ฐ๊ฒฐ ๋ฐ ํ„ฐ๋„๋ง ์„ค์ •
String url = properties.getUrl().replace("[forwardedPort]", Integer.toString(forwardedPort));
log.info(url);
return DataSourceBuilder.create()
.url(url)
.username(properties.getUsername())
.password(properties.getPassword())
.driverClassName(properties.getDriverClassName())
.build();
}

}
Loading
Loading