Skip to content
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

feat: dev cd #27

Merged
merged 19 commits into from
Jul 10, 2024
Merged

feat: dev cd #27

merged 19 commits into from
Jul 10, 2024

Conversation

devmizz
Copy link
Contributor

@devmizz devmizz commented Jul 7, 2024

๐Ÿ˜‹ ์ž‘์—…ํ•œ ๋‚ด์šฉ

  • CD ์ž‘์—…

๐Ÿ™ PR Point

  • Docker hub ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค
  • Github Action์—์„œ EC2์— ๊ณง๋ฐ”๋กœ jar ํŒŒ์ผ๊ณผ Dockerfile, docker-compose.yml์„ ์—…๋กœ๋“œ ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ฒ˜๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค
  • ํ”„๋ฆฌํ‹ฐ์–ด ์„œ๋ฒ„์—์„œ ์ด๋ฏธ์ง€๋ฅผ ์ƒ์„ฑํ•  ๋•Œ CPU๊ฐ€ ์ฃฝ์—ˆ๋Š”๋ฐ, ์Šค์™‘ ๋ฉ”๋ชจ๋ฆฌ ์„ค์ •ํ•ด์„œ ํ•ด๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค

๐Ÿ‘ ๊ด€๋ จ ์ด์Šˆ


@devmizz devmizz added the feat add feature label Jul 7, 2024
@devmizz devmizz requested a review from GaBaljaintheroom July 7, 2024 12:15
@devmizz devmizz self-assigned this Jul 7, 2024
Copy link
Contributor

@GaBaljaintheroom GaBaljaintheroom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฆฌ๋ทฐ ํฌ์ธํŠธ 4
CI.yml์—์„œ๋Š” ์•„์ง ์•„๋ฌด๊ฒƒ๋„ ์—†๋Š”๋ฐ, ์—ฌ๊ธฐ์—๋Š” ์–ด๋–ค ๋‚ด์šฉ์ด ๋“ค์–ด๊ฐ€๋Š”์ง€ ๊ถ๊ธˆํ•ด์š”!

CI์— ๋นŒ๋“œ ํ•˜๋Š” ๋ถ€๋ถ„์„ ๋„ฃ์„ ๊ฑฐ๋ฉด ์ง€๊ธˆ CD์— ์žˆ๋Š” ๋‚ด์šฉ์„ ๋ฐ”ํƒ•์œผ๋กœ

on:
workflow_run:
workflows: ["showpot-dev-ci"]
types:
- completed
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}

์ด๋ ‡๊ฒŒ CI ๋ถ€๋ถ„๊ณผ CD๋ถ€๋ถ„์„ ๋‚˜๋ˆ„๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!

docker-compose.yml Show resolved Hide resolved
.github/workflows/showpot-dev-cd.yml Outdated Show resolved Hide resolved
@devmizz
Copy link
Contributor Author

devmizz commented Jul 8, 2024

๋ฆฌ๋ทฐ ํฌ์ธํŠธ 4 CI.yml์—์„œ๋Š” ์•„์ง ์•„๋ฌด๊ฒƒ๋„ ์—†๋Š”๋ฐ, ์—ฌ๊ธฐ์—๋Š” ์–ด๋–ค ๋‚ด์šฉ์ด ๋“ค์–ด๊ฐ€๋Š”์ง€ ๊ถ๊ธˆํ•ด์š”!

CI์— ๋นŒ๋“œ ํ•˜๋Š” ๋ถ€๋ถ„์„ ๋„ฃ์„ ๊ฑฐ๋ฉด ์ง€๊ธˆ CD์— ์žˆ๋Š” ๋‚ด์šฉ์„ ๋ฐ”ํƒ•์œผ๋กœ

on: workflow_run: workflows: ["showpot-dev-ci"] types: - completed jobs: deploy: if: ${{ github.event.workflow_run.conclusion == 'success' }}

์ด๋ ‡๊ฒŒ CI ๋ถ€๋ถ„๊ณผ CD๋ถ€๋ถ„์„ ๋‚˜๋ˆ„๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!

์š”๊ฑฐ ์ดํ•ด๊ฐ€ ์ž˜ ์•ˆ ๋˜๋Š”๋ฐ, CI.yml์€ ์–ด๋–ค ๊ฑธ ์˜๋ฏธํ•˜์‹œ๋Š” ๊ฑธ๊นŒ์š”!

์ œ๊ฐ€ github action์€ ์ดˆ์งœ๋ผ.. ํ—ˆํ—ˆ! ์ž์„ธํ•œ ์„ค๋ช… ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค..!

@GaBaljaintheroom
Copy link
Contributor

์ œ๊ฐ€ ์ƒ๊ฐํ–ˆ์„ ๋•Œ .github/workflows/showpot-dev-cd.yml ์—๋Š” CI ๋ถ€๋ถ„๊ณผ CD ๋ถ€๋ถ„์ด ๋‹ค ๋“ค์–ด๊ฐ€ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์–ด์š”.
CI๋Š” ์ง€์†์  ํ†ตํ•ฉ์ด๋‹ˆ๊น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜๊ฐ€ ์ž๋™์œผ๋กœ ์ž˜ ํ…Œ์ŠคํŠธ๋˜๊ณ  ๋นŒ๋“œ๋˜๋Š”์ง€๋ฅผ ํ™•์ธํ•˜๋Š” ๊ฒƒ์ด๊ณ  CD๋Š” ์ง€์†์  ๋ฐฐํฌ๋กœ ๋นŒ๋“œ๋œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ฐฐํฌํ•˜๋Š” ์ž‘์—…์ด ๋“ค์–ด๊ฐ€์•ผํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค. showpot-dev-ci.yml์— name: Build with Gradle Wrapper ์—ฌ๊ธฐ ๊นŒ์ง€ ์žˆ๊ณ  showpot-dev-cd.yml ์—๋Š” name: Prepare File for Deployment ์—ฌ๊ธฐ ๋ถ€ํ„ฐ ์žˆ์œผ๋ฉด ์ข‹์ง€ ์•Š์„๊นŒ ์ƒ๊ฐํ•œ ๊ฒƒ ์ž…๋‹ˆ๋‹น!

@devmizz
Copy link
Contributor Author

devmizz commented Jul 9, 2024

@GaBaljaintheroom ๋˜๊ฒŒ ์ข‹์€ ํฌ์ธํŠธ์ธ ๊ฑฐ ๊ฐ™์•„์š”. jar๋ฅผ ์žฌํ™œ์šฉํ•œ๋‹ค๋ฉด action ๋Ÿฐํƒ€์ž„์„ ์ค„์ผ ์ˆ˜ ์žˆ์„ ๊ฑฐ๊ณ ์š”!

๋‹ค๋งŒ ๋ช‡ ๊ฐ€์ง€ ํฌ์ธํŠธ๊ฐ€ ๊ฑธ๋ฆฌ๋„ค์š”!

  1. cd๊ฐ€ ci์— ์ข…์†์ ์ด๊ฒŒ ๋œ๋‹ค.
    ์ ˆ์ฐจ์ƒ์œผ๋กœ๋Š” ํ›„์ˆœ์„œ์ธ ๊ฑด ๋งž์ง€๋งŒ, ci์˜ ํŠน์ • ํ”„๋กœ์„ธ์Šค์— cd๊ฐ€ ๋„ˆ๋ฌด ๊ณผ์˜์กดํ•˜๋Š” ๊ฑด ์•„๋‹Œ๊ฐ€ ์‹ถ์–ด์š”. ci๋‚˜ cd์˜ ๋ฐฉ์‹์ด ๋ณ€๊ฒฝ ๋์„ ๋•Œ, ์„œ๋กœ์—๊ฒŒ ์˜ํ–ฅ์„ ์ค„ ์—ฌ์ง€๊ฐ€ ์žˆ๋Š” ๊ฑฐ ๊ฐ™์•„์„œ์š”!
  2. ๋ฐฐ๋ณด๋‹ค ๋ฐฐ๊ผฝ์ด ๋” ํด ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ.
    ํ˜„์žฌ ์ฐพ์•„๋ณธ ๋ฐฉ๋ฒ•์œผ๋กœ๋Š” artifact๋ฅผ ์ด์šฉํ•˜๊ฑฐ๋‚˜, ๋ณ„๋„์˜ ์ €์žฅ์†Œ๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ์‹์ธ ๊ฑฐ ๊ฐ™์•„์š”. ๊ทผ๋ฐ artifact๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํŠน์ • artifact๋ฅผ ๋‚ด๋ ค ๋ฐ›์•„์„œ ์••์ถ•์„ ํ•ด์ œํ•˜๋Š” ๊ณผ์ •์„ ๊ฑฐ์ณ์•ผ ํ•˜๋Š”๋ฐ, ์ด๊ฒŒ build ํƒ€์ž„๋ณด๋‹ค ์˜ค๋ž˜ ๊ฑธ๋ฆด ์ˆ˜๋„ ์žˆ์ง€ ์•Š๋‚˜?

๊ทธ๋ฆฌ๊ณ  ci์˜ build์™€ cd์˜ build๊ฐ€ ๋ชฉ์ ์ด ๋‹ค๋ฅด๊ธฐ๋„ ํ•ด์„œ, ์ด ๋ถ€๋ถ„๋„ ๊ณ ๋ ค๊ฐ€ ํ•„์š”ํ•  ๊ฑฐ ๊ฐ™์•„์š”!

Copy link
Contributor

@GaBaljaintheroom GaBaljaintheroom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ˆ˜๊ณ  ๋งŽ์œผ์…จ์Šต๋‹ˆ๋‹ค~

@devmizz devmizz merged commit 893e183 into develop Jul 10, 2024
1 check passed
@devmizz devmizz deleted the feat-cd-dev branch July 10, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat add feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants