03. Git flow & CI CD - zmd9220/Aksoo GitHub Wiki

MERGE ์ „๋žต

feature โ†’ develop

  • ๊ฐ™์€ ํŒŒํŠธ ๋‚ด์˜ ํŒ€์›์ด ๋ชจ๋‘ ๋™์˜ํ–ˆ์„ ๊ฒฝ์šฐ
  • ๋™์˜ํ•˜๋Š” ๊ฒฝ์šฐ MR์— ํ™•์ธ ๋ฉ”์„ธ์ง€๋ฅผ ๋‚จ๊ธด๋‹ค

develop โ†’ master

  • CI/CD๊ฐ€ ๊ตฌ์ถ• ๋˜์—ˆ๋‹ค๋ฉด, release๋กœ 1์ฃผ์ผ์— 1ํšŒ(๊ถŒ์žฅ) - ์ˆ˜์š”์ผ
  • ํŒ€์› ์ „์ฒด์˜ ๋™์˜ ํ•„์š”

Branch Style Guide

Structure

feature/ํฌ์ง€์…˜/๊ธฐ๋Šฅ๋ช…

feature ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ ๊ธฐ์ค€ : ์Šคํ† ๋ฆฌ

  • ํฌ์ง€์…˜ : FE/BE/DevOps/AI ๋กœ ๊ตฌ๋ถ„
  • ๊ธฐ๋Šฅ๋ช… : ์ง€๋ผ์˜ ์Šคํ† ๋ฆฌ ๊ธฐ๋Šฅ๋ช…์„ ์ž‘์„ฑ, camelCase์ ์šฉ

์˜ˆ)

feature/FE/mainPage

Git flow / CICD

https://leanpub.com/site_images/git-flow/git-workflow-release-cycle-4maintenance.png

๋ฐฐํฌ ์‚ฌ์ดํด

  • master : ๋ฆฌ์–ผ ์„œ๋ฒ„์— ๋ฐฐํฌ๋˜๋Š” ์„œ๋น„์Šค
  • hotfix : ๋ฆฌ์–ผ ์„œ๋ฒ„์—์„œ ๊ธด๊ธ‰์ƒํ™ฉ ๋ฐœ์ƒ์‹œ ์‚ฌ์šฉ

๊ฐœ๋ฐœ ์‚ฌ์ดํด

  • develop : develop ๊ฐœ๋ฐœ๋ฉ”์ธ ๋ธŒ๋žœ์น˜
  • feature : feature/FE/issueName ํ˜•์‹์œผ๋กœ ์ƒ์„ฑ ๊ธฐ๋Šฅ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜

Git flow

  1. ์Šคํ”„๋ฆฐํŠธ ๋งˆ๋‹ค feature๋“ค์„ ์„ ์ • ๋ฐ ์ž‘์„ฑํ•œ๋‹ค.
  2. develop์—์„œ feature๋ฅผ ๋”ฐ์„œ ์ž‘์—…์„ ํ•œ๋‹ค.
  3. ์ž‘์—…์ด ๋๋‚œ feature ๋Š” develop ์œผ๋กœ ๋จธ์ง€๋œ๋‹ค.
  4. ์Šคํ”„๋ฆฐํŠธ ๋‹จ์œ„๋กœ ์ž‘์—…์ด ๋๋‚˜๋ฉด develop ์—์„œ realease๋กœ ๋จธ์ง€๊ฐ€ ๋œ๋‹ค.(๋ฒ„์ „ ๊ด€๋ฆฌ)
  5. release์—์„œ QA ์ด์ƒ์ด ์—†์„ ์‹œ, ํ•ด๋‹น ๋ฒ„์ „์ด master ๋กœ ๋ฐฐํฌ๊ฐ€ ๋œ๋‹ค.(์ด๋•Œ, ๋ณ‘ํ•ฉํ•œ ์ปค๋ฐ‹์— Release ๋ฒ„์ „ ํƒœ๊ทธ๋ฅผ ๋ถ€์—ฌ!)
  6. QA์—์„œ ๋ฒ„๊ทธ ๋ฐœ์ƒ์‹œ hotfix ๋˜๋Š” ๋‹ค์Œ ์Šคํ”„๋ฆฐํŠธ ๊ณ„ํš์œผ๋กœ ์ž‘์—…ํ•œ๋‹ค.

CI/CD

  • CI : feature -> Test -> develop
  • CD : release -> Deploy -> master

git flow ๋ฐ ๋ฒ„์ „ ๊ด€๋ฆฌ ์ฐธ๊ณ  ์ž๋ฃŒ

CI/CD

CI /CD ๋ž€?

"CI"๋Š” ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ์ž๋™ํ™” ํ”„๋กœ์„ธ์Šค์ธ ์ง€์†์ ์ธ ํ†ตํ•ฉ(Continuous Integration)์„ ์˜๋ฏธํ•œ๋‹ค.

CI๋ฅผ ์„ฑ๊ณต์ ์œผ๋กœ ๊ตฌํ˜„ํ•  ๊ฒฝ์šฐ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ๋Œ€ํ•œ ์ƒˆ๋กœ์šด ์ฝ”๋“œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์ •๊ธฐ์ ์œผ๋กœ ๋นŒ๋“œ ๋ฐ ํ…Œ์ŠคํŠธ๋˜์–ด ๊ณต์œ  ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์— ๋ณ‘ํ•ฉ๋˜๋ฏ€๋กœ ์—ฌ๋Ÿฌ ๋ช…์˜ ๊ฐœ๋ฐœ์ž๊ฐ€ ๋™์‹œ์— ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ๊ณผ ๊ด€๋ จ๋œ ์ฝ”๋“œ ์ž‘์—…์„ ํ•  ๊ฒฝ์šฐ ์„œ๋กœ ์ถฉ๋Œํ•  ์ˆ˜ ์žˆ๋Š” ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค.

"CD"๋Š” ์ง€์†์ ์ธ ์„œ๋น„์Šค ์ œ๊ณต(Continuous Delivery) ๋ฐ/๋˜๋Š” ์ง€์†์ ์ธ ๋ฐฐํฌ(Continuous Deployment)๋ฅผ ์˜๋ฏธํ•˜๋ฉฐ ์ด ๋‘ ์šฉ์–ด๋Š” ์ƒํ˜ธ ๊ตํ™˜์ ์œผ๋กœ ์‚ฌ์šฉ๋œ๋‹ค.

๋‘ ๊ฐ€์ง€ ์˜๋ฏธ ๋ชจ๋‘ ํŒŒ์ดํ”„๋ผ์ธ์˜ ์ถ”๊ฐ€ ๋‹จ๊ณ„์— ๋Œ€ํ•œ ์ž๋™ํ™”๋ฅผ ๋œปํ•˜์ง€๋งŒ ๋•Œ๋กœ๋Š” ์–ผ๋งˆ๋‚˜ ๋งŽ์€ ์ž๋™ํ™”๊ฐ€ ์ด๋ฃจ์–ด์ง€๊ณ  ์žˆ๋Š”์ง€๋ฅผ ์„ค๋ช…ํ•˜๊ธฐ ์œ„ํ•ด ๋ณ„๋„๋กœ ์‚ฌ์šฉ๋˜๊ธฐ๋„ ํ•œ๋‹ค.