Post

CI/CD, which stands for continuous integration and continuous delivery/deployment

CI/CD, which stands for continuous integration and continuous delivery/deployment, is a set of practices that automates the software development process.

This means that code changes can be integrated, tested, and deployed more frequently, which can help to improve the quality of your software and get it to market faster.

๐—›๐—ฒ๐—ฟ๐—ฒโ€™๐˜€ ๐—ฎ ๐—ฏ๐—ฟ๐—ฒ๐—ฎ๐—ธ๐—ฑ๐—ผ๐˜„๐—ป ๐—ผ๐—ณ ๐—ต๐—ผ๐˜„ ๐—–๐—œ/๐—–๐—— ๐˜„๐—ผ๐—ฟ๐—ธ๐˜€ ๐—ผ๐—ป ๐—ฎ ๐—ต๐—ถ๐—ด๐—ต ๐—น๐—ฒ๐˜ƒ๐—ฒ๐—น:

  • โ€ข ๐——๐—ฒ๐˜ƒ๐—ฒ๐—น๐—ผ๐—ฝ๐—บ๐—ฒ๐—ป๐˜: Developers work on their code in a local branch.

  • โ€ข ๐—ฃ๐˜‚๐—น๐—น ๐—ฅ๐—ฒ๐—พ๐˜‚๐—ฒ๐˜€๐˜: When a developer is happy with their changes, they create a pull request. This submits their code for review by other developers.

  • โ€ข ๐—ฃ๐—ฒ๐—ฒ๐—ฟ ๐—ฅ๐—ฒ๐˜ƒ๐—ถ๐—ฒ๐˜„: Other developers review the code and make sure it meets quality standards.

  • โ€ข ๐— ๐—ฒ๐—ฟ๐—ด๐—ฒ: If the code is approved, it is merged into the main branch.

  • โ€ข ๐—–๐—ผ๐—ป๐˜๐—ถ๐—ป๐˜‚๐—ผ๐˜‚๐˜€ ๐—œ๐—ป๐˜๐—ฒ๐—ด๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป: When code is merged into the main branch, a CI pipeline is triggered. This pipeline automates the process of building, testing, and deploying the code.

  • โ€ข ๐—•๐˜‚๐—ถ๐—น๐—ฑ: The code is compiled into an executable application.

  • โ€ข ๐—ง๐—ฒ๐˜€๐˜๐—ถ๐—ป๐—ด: The application is then tested to ensure that it works as expected. This may include unit tests, integration tests, and end-to-end tests.

  • โ€ข ๐—ฃ๐—ฟ๐—ฒ-๐—ฃ๐—ฟ๐—ผ๐—ฑ๐˜‚๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐——๐—ฒ๐—ฝ๐—น๐—ผ๐˜†๐—บ๐—ฒ๐—ป๐˜: If the tests pass, the application is deployed to a pre-production environment. This environment is a replica of the production environment, but it is not accessible to end users.

  • โ€ข ๐—ฃ๐—ฟ๐—ผ๐—ฑ๐˜‚๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐——๐—ฒ๐—ฝ๐—น๐—ผ๐˜†๐—บ๐—ฒ๐—ป๐˜: If the application works well in pre-production, it can be deployed to the production environment. This is the environment that end users will use.

๐—•๐—ฒ๐—ป๐—ฒ๐—ณ๐—ถ๐˜๐˜€ ๐—ผ๐—ณ ๐—–๐—œ/๐—–๐——

There are many benefits to using CI/CD, including:

  • โ€ข Improved software quality: CI/CD helps to identify and fix bugs early in the development process.

  • โ€ข Faster time to market: CI/CD can help you to get your software to market faster.

  • โ€ข Reduced risk: CI/CD can help to reduce the risk of deploying broken code to production.

  • โ€ข Increased developer productivity: CI/CD can help developers to focus on writing code instead of manual tasks.

๐—š๐—ฒ๐˜๐˜๐—ถ๐—ป๐—ด ๐—ฆ๐˜๐—ฎ๐—ฟ๐˜๐—ฒ๐—ฑ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—œ/๐—–๐——

There are a number of CI/CD tools available, such as Jenkins, GitLab, and CircleCI.

These tools can help you to automate the CI/CD pipeline.

If youโ€™re looking to improve your software development process, CI/CD is a great place to start.

By automating the process of building, testing, and deploying your code, you can deliver high-quality software faster and with less risk.

 How CI/CD Works

Translate to Korean

CI/CD๋Š” Continuous Integration ๋ฐ Continuous Delivery/Deployment์˜ ์•ฝ์ž๋กœ ์†Œํ”„ํŠธ์›จ์–ด ๊ฐœ๋ฐœ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ž๋™ํ™”ํ•˜๋Š” ์ผ๋ จ์˜ ๊ด€ํ–‰์ž…๋‹ˆ๋‹ค.

์ฆ‰, ์ฝ”๋“œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ๋” ์ž์ฃผ ํ†ตํ•ฉ, ํ…Œ์ŠคํŠธ ๋ฐ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์†Œํ”„ํŠธ์›จ์–ด ํ’ˆ์งˆ์„ ๊ฐœ์„ ํ•˜๊ณ  ์‹œ์žฅ์— ๋” ๋นจ๋ฆฌ ์ถœ์‹œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ์€ CI/CD๊ฐ€ ๋†’์€ ์ˆ˜์ค€์—์„œ ์ž‘๋™ํ•˜๋Š” ๋ฐฉ์‹์— ๋Œ€ํ•œ ๋ถ„์„์ž…๋‹ˆ๋‹ค.

  • โ€ข ๊ฐœ๋ฐœ: ๊ฐœ๋ฐœ์ž๋Š” ๋กœ์ปฌ ๋ธŒ๋žœ์น˜์—์„œ ์ฝ”๋“œ ์ž‘์—…์„ ํ•ฉ๋‹ˆ๋‹ค.

  • โ€ข ํ’€ ๋ฆฌํ€˜์ŠคํŠธ(Pull Request): ๊ฐœ๋ฐœ์ž๊ฐ€ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ๋งŒ์กฑ์Šค๋Ÿฌ์šฐ๋ฉด ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๊ฐ€ ๊ฒ€ํ† ํ•  ์ˆ˜ ์žˆ๋„๋ก ์ฝ”๋“œ๊ฐ€ ์ œ์ถœ๋ฉ๋‹ˆ๋‹ค.

  • โ€ข ๋™๋ฃŒ ํ‰๊ฐ€: ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๊ฐ€ ์ฝ”๋“œ๋ฅผ ๊ฒ€ํ† ํ•˜๊ณ  ํ’ˆ์งˆ ํ‘œ์ค€์„ ์ถฉ์กฑํ•˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  • โ€ข ๋ณ‘ํ•ฉ: ์ฝ”๋“œ๊ฐ€ ์Šน์ธ๋˜๋ฉด ๊ธฐ๋ณธ ๋ถ„๊ธฐ์— ๋ณ‘ํ•ฉ๋ฉ๋‹ˆ๋‹ค.

  • โ€ข ์ง€์†์  ํ†ตํ•ฉ: ์ฝ”๋“œ๊ฐ€ ๊ธฐ๋ณธ ๋ถ„๊ธฐ์— ๋ณ‘ํ•ฉ๋˜๋ฉด CI ํŒŒ์ดํ”„๋ผ์ธ์ด ํŠธ๋ฆฌ๊ฑฐ๋ฉ๋‹ˆ๋‹ค. ์ด ํŒŒ์ดํ”„๋ผ์ธ์€ ์ฝ”๋“œ๋ฅผ ๋นŒ๋“œ, ํ…Œ์ŠคํŠธ ๋ฐ ๋ฐฐํฌํ•˜๋Š” ํ”„๋กœ์„ธ์Šค๋ฅผ ์ž๋™ํ™”ํ•ฉ๋‹ˆ๋‹ค.

  • โ€ข ๋นŒ๋“œ: ์ฝ”๋“œ๊ฐ€ ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์œผ๋กœ ์ปดํŒŒ์ผ๋ฉ๋‹ˆ๋‹ค.

  • โ€ข ํ…Œ์ŠคํŠธ: ๊ทธ๋Ÿฐ ๋‹ค์Œ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์„ ํ…Œ์ŠคํŠธํ•˜์—ฌ ์˜ˆ์ƒ๋Œ€๋กœ ์ž‘๋™ํ•˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ๋‹จ์œ„ ํ…Œ์ŠคํŠธ, ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ ๋ฐ ์ข…๋‹จ ๊ฐ„ ํ…Œ์ŠคํŠธ๊ฐ€ ํฌํ•จ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • โ€ข ์‚ฌ์ „ ํ”„๋กœ๋•์…˜ ๋ฐฐํฌ: ํ…Œ์ŠคํŠธ๋ฅผ ํ†ต๊ณผํ•˜๋ฉด ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์ด ์‚ฌ์ „ ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ์— ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค. ์ด ํ™˜๊ฒฝ์€ ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ์˜ ๋ณต์ œ๋ณธ์ด์ง€๋งŒ ์ตœ์ข… ์‚ฌ์šฉ์ž๊ฐ€ ์•ก์„ธ์Šคํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

  • โ€ข ํ”„๋กœ๋•์…˜ ๋ฐฐํฌ: ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์ด ์‚ฌ์ „ ํ”„๋กœ๋•์…˜์—์„œ ์ž˜ ์ž‘๋™ํ•˜๋Š” ๊ฒฝ์šฐ ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ์— ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํ™˜๊ฒฝ์€ ์ตœ์ข… ์‚ฌ์šฉ์ž๊ฐ€ ์‚ฌ์šฉํ•  ํ™˜๊ฒฝ์ž…๋‹ˆ๋‹ค.

CI/CD์˜ ์ด์ 

CI/CD๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋งŽ์€ ์ด์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  • โ€ข ์†Œํ”„ํŠธ์›จ์–ด ํ’ˆ์งˆ ํ–ฅ์ƒ: CI/CD๋Š” ๊ฐœ๋ฐœ ํ”„๋กœ์„ธ์Šค ์ดˆ๊ธฐ์— ๋ฒ„๊ทธ๋ฅผ ์‹๋ณ„ํ•˜๊ณ  ์ˆ˜์ •ํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค.

  • โ€ข ์‹œ์žฅ ์ถœ์‹œ ์‹œ๊ฐ„ ๋‹จ์ถ•: CI/CD๋ฅผ ํ†ตํ•ด ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ๋” ๋นจ๋ฆฌ ์ถœ์‹œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • โ€ข ์œ„ํ—˜ ๊ฐ์†Œ: CI/CD๋Š” ์†์ƒ๋œ ์ฝ”๋“œ๋ฅผ ํ”„๋กœ๋•์…˜์— ๋ฐฐํฌํ•˜๋Š” ์œ„ํ—˜์„ ์ค„์ด๋Š” ๋ฐ ๋„์›€์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • โ€ข ๊ฐœ๋ฐœ์ž ์ƒ์‚ฐ์„ฑ ํ–ฅ์ƒ: CI/CD๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ์ˆ˜๋™ ์ž‘์—… ๋Œ€์‹  ์ฝ”๋“œ ์ž‘์„ฑ์— ์ง‘์ค‘ํ•  ์ˆ˜ ์žˆ๋„๋ก ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

CI/CD ์‹œ์ž‘ํ•˜๊ธฐ

Jenkins, GitLab ๋ฐ CircleCI์™€ ๊ฐ™์€ ๋‹ค์–‘ํ•œ CI/CD ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋Ÿฌํ•œ ๋„๊ตฌ๋Š” CI/CD ํŒŒ์ดํ”„๋ผ์ธ์„ ์ž๋™ํ™”ํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์†Œํ”„ํŠธ์›จ์–ด ๊ฐœ๋ฐœ ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ฐœ์„ ํ•˜๋ ค๋Š” ๊ฒฝ์šฐ CI/CD๋ฅผ ์‹œ์ž‘ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

์ฝ”๋“œ ๋นŒ๋“œ, ํ…Œ์ŠคํŠธ ๋ฐ ๋ฐฐํฌ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ž๋™ํ™”ํ•˜๋ฉด ์œ„ํ—˜์„ ์ค„์ด๋ฉด์„œ ๊ณ ํ’ˆ์งˆ ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ๋” ๋น ๋ฅด๊ฒŒ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

This post is licensed under CC BY 4.0 by the author.