Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
โ€ฆng-ggood into fix/935-autologin
  • Loading branch information
ooherin committed Nov 5, 2024
2 parents 6c9c436 + abb492c commit 2076c6c
Show file tree
Hide file tree
Showing 253 changed files with 15,487 additions and 40 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: backend-ci

on:
pull_request:
branches: [ "main", "dev", "dev-be" ]
paths: 'backend/**'

defaults:
run:
working-directory: backend/bang-ggood
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: 8.8

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Write application.yml
env:
APPLICATION_YML: ${{ secrets.APPLICATION_YML }}
APPLICATION_LOCAL_YML: ${{ secrets.APPLICATION_LOCAL_YML }}
APPLICATION_TEST_YML: ${{ secrets.APPLICATION_TEST_YML }}
APPLICATION_READ_WRITE_TEST_YML: ${{ secrets.APPLICATION_READ_WRITE_TEST_YML }}

run: |
echo "${APPLICATION_YML}" > src/test/resources/application.yml
echo "${APPLICATION_LOCAL_YML}" > src/test/resources/application-local.yml
echo "${APPLICATION_TEST_YML}" > src/test/resources/application-test.yml
echo "${APPLICATION_READ_WRITE_TEST_YML}" > src/test/resources/application-read-write-test.yml
- name: Build with Gradle
run: ./gradlew clean build


83 changes: 83 additions & 0 deletions .github/workflows/backend-dev-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: backend-dev-cd

on:
pull_request:
branches: [ "dev" ]
types: [closed]

jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: 8.8

- name: Grant execute permission for gradlew
run: chmod +x backend/bang-ggood/gradlew

- name: Write application.yml
env:
APPLICATION_YML: ${{ secrets.APPLICATION_YML }}
APPLICATION_DEV_YML: ${{ secrets.APPLICATION_DEV_YML }}
APPLICATION_TEST_YML: ${{ secrets.APPLICATION_TEST_YML }}
APPLICATION_READ_WRITE_TEST_YML: ${{ secrets.APPLICATION_READ_WRITE_TEST_YML }}

run: |
echo "${APPLICATION_YML}" > backend/bang-ggood/src/main/resources/application.yml
echo "${APPLICATION_DEV_YML}" > backend/bang-ggood/src/main/resources/application-dev.yml
echo "${APPLICATION_TEST_YML}" > backend/bang-ggood/src/test/resources/application-test.yml
echo "${APPLICATION_READ_WRITE_TEST_YML}" > backend/bang-ggood/src/test/resources/application-read-write-test.yml
- name: Build with Gradle
run: ./gradlew clean build
working-directory: backend/bang-ggood

- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
working-directory: backend/bang-ggood
name: bang-ggood-be-develop-jar
path: ./**/*.jar

deploy:
needs: build
runs-on: bang-ggood-dev
steps:
- name: change permission
run: sudo chown -R ubuntu:ubuntu /home/ubuntu/actions-runner/_work/2024-bang-ggood

- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: bang-ggood-be-develop-jar

- name: Create unhealth_flag file
run: echo "unhealth" | sudo tee /etc/nginx/sites-available/unhealth_flag.txt > /dev/null


- name: Sleep for 30 seconds
run: sleep 30

- name: Turn off the server 8080 if runs
run: sudo fuser -k -n tcp 8080 || true

- name: Start server
run: sudo nohup java -jar -Dspring.profiles.active=dev -Duser.timezone=Asia/Seoul ./backend/bang-ggood/build/libs/*SNAPSHOT.jar > /home/ubuntu/actions-runner/server.log 2>&1 &

- name: Delete unhealth_flag file
run: sudo rm /etc/nginx/sites-available/unhealth_flag.txt
91 changes: 91 additions & 0 deletions .github/workflows/backend-prod-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: backend-prod-cd

on:
pull_request:
branches: [ "main" ]
types: [closed]

jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: 8.8

- name: Grant execute permission for gradlew
run: chmod +x backend/bang-ggood/gradlew

- name: Write application.yml
env:
APPLICATION_YML: ${{ secrets.APPLICATION_YML }}
APPLICATION_PROD_YML: ${{ secrets.APPLICATION_PROD_YML }}
APPLICATION_TEST_YML: ${{ secrets.APPLICATION_TEST_YML }}
APPLICATION_READ_WRITE_TEST_YML: ${{ secrets.APPLICATION_READ_WRITE_TEST_YML }}

run: |
echo "${APPLICATION_YML}" > backend/bang-ggood/src/main/resources/application.yml
echo "${APPLICATION_PROD_YML}" > backend/bang-ggood/src/main/resources/application-prod.yml
echo "${APPLICATION_TEST_YML}" > backend/bang-ggood/src/test/resources/application-test.yml
echo "${APPLICATION_READ_WRITE_TEST_YML}" > backend/bang-ggood/src/test/resources/application-read-write-test.yml
- name: Build with Gradle
run: ./gradlew clean build
working-directory: backend/bang-ggood

- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
working-directory: backend/bang-ggood
name: bang-ggood-be-develop-jar
path: ./**/*.jar

deploy1:
needs: build
runs-on: bang-ggood-prod1
steps:
- name: Change permission
run: sudo chown -R ubuntu:ubuntu /home/ubuntu/actions-runner/_work/2024-bang-ggood

- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: bang-ggood-be-develop-jar

- name: Turn off the server 8080 if it runs
run: sudo fuser -k -n tcp 8080 || true

- name: Start server
run: sudo nohup java -jar -Dspring.profiles.active=prod -Duser.timezone=Asia/Seoul ./backend/bang-ggood/build/libs/*SNAPSHOT.jar > /home/ubuntu/actions-runner/server.log 2>&1 &

deploy2:
needs: deploy1
runs-on: bang-ggood-prod2
steps:
- name: Change permission
run: sudo chown -R ubuntu:ubuntu /home/ubuntu/actions-runner/_work/2024-bang-ggood

- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: bang-ggood-be-develop-jar

- name: Turn off the server 8080 if it runs
run: sudo fuser -k -n tcp 8080 || true

- name: Start server
run: sudo nohup java -jar -Dspring.profiles.active=prod -Duser.timezone=Asia/Seoul ./backend/bang-ggood/build/libs/*SNAPSHOT.jar > /home/ubuntu/actions-runner/server.log 2>&1 &
42 changes: 42 additions & 0 deletions .github/workflows/discord-pr-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Discord PR

on:
pull_request:
branches: ["dev-be"]
paths: 'backend/**'

jobs:
create-issue:
name: Discord notification
runs-on: ubuntu-latest
steps:
- name: Send PR
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
DISCORD_USERNAME: Bang_GGood_Master
DISCORD_EMBEDS: >
[
{
"title": "๋˜‘๋˜‘~ ๋ฐฉ ๋ฆฌ๋ชจ๋ธ๋ง ์š”์ฒญ์ด ์™”์–ด์š”!๐Ÿ \n${{ github.event.pull_request.title }}",
"color": 16777123,
"description": "${{ github.event.pull_request.html_url }}",
"fields": [
{
"name": "Pull Request Number",
"value": "#${{ github.event.pull_request.number }}",
"inline": true
},
{
"name": "Author",
"value": "${{ github.event.pull_request.user.login }}",
"inline": true
},
{
"name": "Reviewers",
"value": "${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }}",
"inline": false
}
]
}
]
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/2024-bang-ggood.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ๋ฐฉ๋—; ๋ฐฉ ๊ตฌํ•˜๊ธฐ ๋—, ๊ทธ๋ž˜์„œ ๋ฐฉ๊ธ‹ :)

![แ„‡แ…กแ†ผแ„‡แ…กแ†ผแ„‹แ…ตแ„‡แ…ขแ„‚แ…ฅ](https://github.com/user-attachments/assets/d8615115-6a82-444b-bbb4-2c03a554884e)

์ƒˆ ์ถœ๋ฐœ์„ ์œ„ํ•ด ์ƒˆ์ง‘์„ ๊ตฌํ•ด์•ผ ํ•˜๋Š” ๋‹น์‹ !
๋ฐฉ์„ ๊ตฌํ•œ ๊ฒฝํ—˜๊ณผ ์ง€์‹์ด ๋ถ€์กฑํ•œ ์ž์ทจ ์ดˆ๋ณด๋ผ๋ฉด, ์–ด๋–ป๊ฒŒ ๋ฐฉ์„ ๊ตฌํ•ด์•ผ ํ• ์ง€ ๋ง‰๋ง‰ํ• ์ง€๋„ ๋ชฐ๋ผ์š”.

๋ฐฉ์„ ๋ณด๋Š” ์‹œ๊ฐ„์€ **๋‹จ 10๋ถ„!**

โ€œ์–ด๋””์„œ๋ถ€ํ„ฐ ๋ด์•ผ ํ•˜์ง€? ๋ฌด์—‡์„ ๋ด์•ผ ๋˜์ง€?โ€
โ€๋‚ด ๋ˆˆ์—๋Š” ๋‹ค ์ข‹์•„๋ณด์ด๋Š”๋ฐ?โ€
โ€๋ฐฉ๊ธˆ ๋ดค๋˜ ์ง‘๋“ค์„ ๋‹ค ๊ธฐ์–ตํ•˜๊ธฐ ํž˜๋“ ๋ฐ.."

**๋ฐฉ๋—**์€ ์ด๋Ÿฐ ๊ณ ๋ฏผํ•˜๋Š” ์ž์ทจ ์ดˆ๋ณด๋“ค์„ ์œ„ํ•ด,
โ—๏ธ ๋ฐฉ์„ ๋‘˜๋Ÿฌ๋ณผ ๋•Œ ๊นœ๋นกํ•  ์ˆ˜ ์žˆ๋Š”, ์œ ์‹ฌํžˆ ์‚ดํŽด๋ด์•ผ ํ•  ๊ฒƒ๋“ค์„ **์ฒดํฌ๋ฆฌ์ŠคํŠธ**๋กœ ์•Œ๋ ค ๋“œ๋ ค์š”.
โ—๏ธ ์—ฌ๋Ÿฌ๋ถ„์ด ์ค‘์š”ํ•˜๊ฒŒ ์ƒ๊ฐํ•˜๋Š” **์งˆ๋ฌธ๋งŒ ๋ชจ์•„**์„œ ๋‚˜๋งŒ์˜ ์ฒดํฌ๋ฆฌ์ŠคํŠธ๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ์–ด์š”.
โ—๏ธ ์—ฌ๋Ÿฌ ๋ฐฉ์„ ๋Œ์•„๋ณด๋ฉฐ ์ž‘์„ฑํ–ˆ๋˜ ์ฒดํฌ๋ฆฌ์ŠคํŠธ๋“ค์„ ๋น„๊ตํ•˜์—ฌ ์—ฌ๋Ÿฌ๋ถ„์—๊ฒŒ **์ตœ์ ์˜ ๋ฐฉ์„ ์ถ”์ฒœ**ํ•ด๋“œ๋ ค์š”.

๋‚˜๋งŒ์˜ ์ฒดํฌ๋ฆฌ์ŠคํŠธ๋กœ ์ตœ์ ์˜ ๋ฐฉ์„ ์ฐพ์•„ ๋‚˜๊ฐ€๋Š” ๊ณผ์ •, ๋ฐฉ๋—์ด ํ•จ๊ป˜ํ• ๊ฒŒ์š”.
์ž์ทจ๋ฐฉ์—์„œ ๋ฐฉ๊ธ‹ ์›ƒ์„ ์ˆ˜ ์žˆ๊ฒŒ, ๋ฐฉ๋—์„ ์‚ฌ์šฉํ•ด ๋ณด์„ธ์š”!ย โ˜บ๏ธ
Binary file added backend/bang-ggood/.DS_Store
Binary file not shown.
39 changes: 39 additions & 0 deletions backend/bang-ggood/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
src/main/resources/*.yml
src/test/resources/*.yml
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
Loading

0 comments on commit 2076c6c

Please sign in to comment.