Skip to content

Latest commit

ย 

History

History
59 lines (44 loc) ยท 3.65 KB

File metadata and controls

59 lines (44 loc) ยท 3.65 KB

CI / CD ๊ฐœ๋ฐœ ํ”„๋กœ์„ธ์Šค

Continuous Integration(์ง€์†์ ์ธ ํ†ตํ•ฉ) and Continuous Delivery(์ง€์†์ ์ธ ์ œ๊ณต) ํ˜น์€ Continuous Deployment(์ง€์†์ ์ธ ๋ฐฐํฌ)

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


CI (Continuous Integration, ์ง€์†์ ์ธ ํ†ตํ•ฉ)

  • merge, build, test ์ž๋™ํ™” ๊ณผ์ •
  • ๋ฒ„๊ทธ ์ˆ˜์ •์ด๋‚˜ ์ƒˆ๋กœ ๋งŒ๋“œ๋Š” ๊ธฐ๋Šฅ๋“ค์ด main repository์— ์ฃผ๊ธฐ์ ์œผ๋กœ ๋นŒ๋“œ๋˜๊ณ  ํ…Œ์ŠคํŠธ๋˜๋ฉด์„œ merge ๋˜๋Š” ๊ฒƒ์„ ์˜๋ฏธ
  1. ๊ฐœ๋ฐœ์ž๋“ค์€ ์ฝ”๋“œ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ์ฃผ๊ธฐ์ ์œผ๋กœ ๋นˆ๋ฒˆํ•˜๊ฒŒ ๋จธ์ง€ํ•ด์•ผ ํ•œ๋‹ค.
    • merge ์ถฉ๋Œ์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด์„œ ๊ฐœ๋ฐœ์ž๋“ค์€ ์ž‘์€ ๋‹จ์œ„๋กœ ๊ฐœ๋ฐœํ•˜๊ณ  ํ†ตํ•ฉํ•ด๋‚˜๊ฐ€์•ผํ•œ๋‹ค.

  2. ํ†ตํ•ฉ์„ ์œ„ํ•œ ๋‹จ๊ณ„ (๋นŒ๋“œ, ํ…Œ์ŠคํŠธ, ๋จธ์ง€)์˜ ์ž๋™ํ™”
    • ์ฃผ๊ธฐ์ ์œผ๋กœ merge๋œ ์ฝ”๋“œ์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์ž๋™์œผ๋กœ Build๊ฐ€ ๋˜์–ด์„œ ์ฝ”๋“œ๊ฐ€ ๋ณ€๊ฒฝ๋œ ํ›„์—๋„ ์ฝ”๋“œ๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ Build๊ฐ€ ๋˜๋Š”์ง€ ํ™•์ธ์ด ๋˜์•ผํ•˜๊ณ , ์ฝ”๋“œ์˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ ๋ฟ ์•„๋‹ˆ๋ผ ์‹œ์Šคํ…œ์— ๋‹ค๋ฅธ ๋ฒ„๊ทธ๋ฅผ ์ดˆ๋ž˜ํ•˜์ง„ ์•Š์•˜๋Š”์ง€ ์ž๋™์œผ๋กœ test๊นŒ์ง€ ๋˜์–ด์•ผ ํ•œ๋‹ค.
    • CI ๊ตฌํ˜„ ์‹œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ๋Œ€ํ•œ ์ƒˆ๋กœ์šด ์ฝ”๋“œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์ •๊ธฐ์ ์œผ๋กœ ๋นŒ๋“œ/ํ…Œ์ŠคํŠธ ๋˜์–ด ๊ณต์œ  ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์— ํ†ตํ•ฉ๋œ๋‹ค.
    • ์ปค๋ฐ‹ํ•  ๋•Œ๋งˆ๋‹ค ๋นŒ๋“œ์™€ ์ผ๋ จ์˜ ์ž๋™ ํ…Œ์ŠคํŠธ๊ฐ€ ์ด๋ฃจ์–ด์ ธ ๋™์ž‘์„ ํ™•์ธํ•˜๊ณ  ๋ณ€๊ฒฝ์œผ๋กœ ์ธํ•ด ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธฐ๋Š” ๋ถ€๋ถ„์ด ์—†๋„๋ก ๋ณด์žฅํ•œ๋‹ค.
    • ์ง€์†์  ํ†ตํ•ฉ์€ CI/CD ํŒŒ์ดํ”„๋ผ์ธ์„ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•œ ์ฒซ ๋ฒˆ์งธ ๋‹จ๊ณ„์ด๊ธฐ๋„ ํ•˜๋‹ค.

  1. ๊ฐœ๋ฐœ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ main repo์— merge ํ•œ๋‹ค.
  2. merge ํ›„ ์ž๋™์œผ๋กœ ํŒ€์—์„œ ๋งŒ๋“  CI script๋ฅผ ํ†ตํ•ด ์ถ”๊ฐ€๋œ ์ฝ”๋“œ์™€ ํ•จ๊ป˜ repository๊ฐ€ build๊ฐ€ ๋œ๋‹ค.
  3. build ์„ฑ๊ณต ์‹œ ํŒ€์—์„œ ์ž‘์„ฑํ•œ Unit test, Integration test ๋“ฑ ์—ฌ๋Ÿฌ๊ฐ€์ง€ test๋“ค๋„ script๋ฅผ ํ†ตํ•ด์„œ ์‹คํ–‰์ด ๋œ๋‹ค.
  4. a. build/test ์„ฑ๊ณต ํ›„ green sign์ด ๋œจ๋ฉด ๋ฐฐํฌํ•  ๋•Œ ๋ฐ˜์˜๋œ๋‹ค. b. ์ƒˆ๋กœ ์ถ”๊ฐ€ํ•œ ์ฝ”๋“œ์— ๋ฌธ์ œ๊ฐ€ ์žˆ์–ด์„œ build ์‹คํŒจ ํ˜น์€ build ์„ฑ๊ณต ํ›„ ํ…Œ์ŠคํŠธ ์‹คํŒจ ์‹œ red sign์ด ๋œจ๋ฉด ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚จ ๊ฐœ๋ฐœ์ž์—๊ฒŒ ์ž๋™์œผ๋กœ ์•Œ๋ฆผ์„ ์ค€๋‹ค.

CD (์ง€์†์ ์ธ ์ œ๊ณต(Continuous Delivery) ๋˜๋Š” ์ง€์†์ ์ธ ๋ฐฐํฌ(Continuous Deployment))

  • ๋งˆ์ง€๋ง‰ ๋ฐฐํฌ ๋‹จ๊ณ„์—์„œ ์–ด๋–ป๊ฒŒ ํ•˜๋ฉด ์ž๋™ํ™”ํ•ด์„œ ๋ฐฐํฌ๋ฅผ ํ•  ์ˆ˜ ์žˆ์„์ง€ ๊ณ ๋ฏผํ•˜๋Š” ๋‹จ๊ณ„
  • ์œ„์˜ ๋‘ ์˜๋ฏธ ๋ชจ๋‘ ํŒŒ์ดํ”„๋ผ์ธ์˜ ์ถ”๊ฐ€ ๋‹จ๊ณ„์— ๋Œ€ํ•œ ์ž๋™ํ™”๋ฅผ ๋œปํ•˜์ง€๋งŒ, ์–ผ๋งˆ๋‚˜ ๋งŽ์€ ์ž๋™ํ™”๊ฐ€ ์ด๋ฃจ์–ด์ง€๊ณ  ์žˆ๋Š”์ง€๋ฅผ ์„ค๋ช…ํ•˜๊ธฐ ์œ„ํ•ด ๋ณ„๋„๋กœ ์‚ฌ์šฉ๋˜๊ธฐ๋„ ํ•œ๋‹ค.
    • Deployment : ๋ฐฐํฌ ๋‹จ๊ณ„๋ฅผ ์ž๋™ํ™”
      • CI๋ฅผ ๋งˆ์น˜๊ณ  ๋ฆด๋ฆฌ์ฆˆ๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ๋ฐฐํฌ๊นŒ์ง€ ์ž๋™์œผ๋กœ ์ด๋ฃจ์–ด์ง€๋Š” ๊ฒฝ์šฐ
    • Delivery : ๋ฐฐํฌ ๋‹จ๊ณ„๋ฅผ ์ˆ˜๋™ํ™”
      • CI๋ฅผ ๋งˆ์น˜๊ณ  ๋ฆด๋ฆฌ์ฆˆ๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ๋ฐฐํฌ ๋‹จ๊ณ„์—์„œ ์‚ฌ๋žŒ(๊ฐœ๋ฐœ์ž ํ˜น์€ ๊ฒ€์ฆํŒ€)์˜ ๊ฒ€์ฆ์„ ํ†ตํ•ด ์ˆ˜๋™์ ์œผ๋กœ ๋ฐฐํฌ๊ฐ€ ์ด๋ฃจ์–ด์ง€๋Š” ๊ฒฝ์šฐ
  • ์ฝ”๋“œ ๋ณ€๊ฒฝ์ด ํŒŒ์ดํ”„๋ผ์ธ์˜ ์ด์ „ ๋‹จ๊ณ„๋ฅผ ๋ชจ๋‘ ์„ฑ๊ณต์ ์œผ๋กœ ํ†ต๊ณผํ•˜๋ฉด ์ˆ˜๋™ ๊ฐœ์ž… ์—†์ด ํ•ด๋‹น ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ํ”„๋กœ๋•์…˜์— ์ž๋™์œผ๋กœ ๋ฐฐํฌ๋œ๋‹ค. (Continuous Deployment)
  • ์ง€์†์  ๋ฐฐํฌ๋ฅผ ์ฑ„ํƒํ•˜๋ฉด ํ’ˆ์งˆ ์ €ํ•˜ ์—†์ด ์ตœ๋Œ€ํ•œ ๋นจ๋ฆฌ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ๋‹ค.


CI/CD Pipeline


CI/CD tools

  • ์  ํ‚จ์Šค (Jenkins)
  • Buildkite
  • Github Actions
  • Circle CI
  • AWS Code Deploy
  • Travis CI