# CI/CD

> Automation that builds, tests and ships every code change, so releases become routine.

- Level: Intermediate
- Topics: Software
- URL: https://tidbit.legios.com.ar/ci-cd/
- In Spanish: [CI/CD](https://tidbit.legios.com.ar/es/ci-cd/)

**CI/CD** names two linked practices. **Continuous integration** (CI) means developers merge their changes into the shared code often, at least daily, and every merge automatically triggers a build and a run of the automated tests. If something breaks, the team learns within minutes, while the change is still fresh, instead of weeks later.

The CD half has two flavors. **Continuous delivery** keeps the code always ready to release: every change that passes the checks is packaged and can go to production with the press of a button. **Continuous deployment** goes one step further and releases every passing change automatically, with no button. Teams pick based on how much risk and human approval their product needs.

The automation runs as a **pipeline**: a list of steps written in a file inside the repository, such as "install, build, run tests, scan for vulnerabilities, build the container image, deploy to staging, deploy to production". Services like GitHub Actions, GitLab CI and Jenkins run these pipelines on every push. The payoff is that shipping software stops being a scary monthly event and becomes a small, frequent, boring one, which is exactly what you want.

## An analogy

An assembly line with quality checks at every station. Each part is inspected as soon as it is added, and a defective one stops the belt before it reaches the customer, not after a full truck has left.

## Keep in mind

- CI: merge often and test every change automatically.
- Continuous delivery: always ready to release. Continuous deployment: releases automatically.
- The pipeline is a file in the repository, so it is versioned like code.
- Small, frequent releases are easier to check and to undo than big ones.

## Go deeper

- [What is continuous integration? (AWS)](https://aws.amazon.com/devops/continuous-integration/)
- [What is CI/CD? (GitLab)](https://about.gitlab.com/topics/ci-cd/)
- [CI/CD on Wikipedia](https://en.wikipedia.org/wiki/CI/CD)

## Related terms

- [Software testing](https://tidbit.legios.com.ar/software-testing/): Checking that software does what it should, mostly with code that tests other code.
- [Vulnerability and CVE](https://tidbit.legios.com.ar/vulnerability-and-cve/): A flaw that lets an attacker misuse software, and the public id that names it.
- [Container](https://tidbit.legios.com.ar/container/): A sealed box with a program and everything it needs to run anywhere.
- [GitHub](https://tidbit.legios.com.ar/github/): A website where teams store their code with Git and work on it together.
