debian-mirror-gitlab/doc/ci/introduction/index.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

118 lines
5.4 KiB
Markdown
Raw Normal View History

2019-07-07 11:18:12 +05:30
---
2020-06-23 00:09:42 +05:30
stage: Verify
2023-05-27 22:25:52 +05:30
group: Pipeline Authoring
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2019-07-07 11:18:12 +05:30
description: "An overview of Continuous Integration, Continuous Delivery, and Continuous Deployment, as well as an introduction to GitLab CI/CD."
2019-09-04 21:01:54 +05:30
type: concepts
2019-07-07 11:18:12 +05:30
---
2021-03-11 19:13:27 +05:30
# CI/CD concepts **(FREE)**
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
With the continuous method of software development, you continuously build,
test, and deploy iterative code changes. This iterative process helps reduce
the chance that you develop new code based on buggy or failed previous versions.
With this method, you strive to have less human intervention or even no intervention at all,
from the development of new code until its deployment.
The three primary approaches for the continuous method are:
- [Continuous Integration](#continuous-integration)
- [Continuous Delivery](#continuous-delivery)
- [Continuous Deployment](#continuous-deployment)
2019-07-07 11:18:12 +05:30
2020-07-28 23:09:34 +05:30
Out-of-the-box management systems can decrease hours spent on maintaining toolchains by 10% or more.
Watch our ["Mastering continuous software development"](https://about.gitlab.com/webcast/mastering-ci-cd/)
2021-03-11 19:13:27 +05:30
webcast to learn about continuous methods and how built-in GitLab CI/CD can help you simplify and scale software development.
2019-10-12 21:52:04 +05:30
2023-03-17 16:20:25 +05:30
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i>Learn how to: [configure CI/CD](https://www.youtube.com/watch?v=opdLqwz6tcE).
- [Make the case for CI/CD in your organization](https://about.gitlab.com/devops-tools/github-vs-gitlab/).
- Learn how [Verizon reduced rebuilds](https://about.gitlab.com/blog/2019/02/14/verizon-customer-story/) from 30 days to under 8 hours with GitLab.
2021-01-29 00:20:46 +05:30
2021-03-11 19:13:27 +05:30
## Continuous Integration
2019-07-07 11:18:12 +05:30
2019-12-26 22:10:19 +05:30
Consider an application that has its code stored in a Git
2019-07-07 11:18:12 +05:30
repository in GitLab. Developers push code changes every day,
multiple times a day. For every push to the repository, you
can create a set of scripts to build and test your application
2021-03-11 19:13:27 +05:30
automatically. These scripts help decrease the chances that you introduce errors in your application.
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
This practice is known as [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration).
Each change submitted to an application, even to development branches,
is built and tested automatically and continuously. These tests ensure the
changes pass all tests, guidelines, and code compliance
standards you established for your application.
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
[GitLab itself](https://gitlab.com/gitlab-org/gitlab) is an
example of a project that uses Continuous Integration as a software
development method. For every push to the project, a set
of checks run against the code.
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
## Continuous Delivery
2019-07-07 11:18:12 +05:30
[Continuous Delivery](https://continuousdelivery.com/) is a step
2021-03-11 19:13:27 +05:30
beyond Continuous Integration. Not only is your application
built and tested each time a code change is pushed to the codebase,
the application is also deployed continuously. However, with continuous
delivery, you trigger the deployments manually.
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
Continuous Delivery checks the code automatically, but it requires
2019-07-07 11:18:12 +05:30
human intervention to manually and strategically trigger the deployment
of the changes.
2021-03-11 19:13:27 +05:30
## Continuous Deployment
2019-07-07 11:18:12 +05:30
[Continuous Deployment](https://www.airpair.com/continuous-deployment/posts/continuous-deployment-for-practical-people)
2021-03-11 19:13:27 +05:30
is another step beyond Continuous Integration, similar to
2019-07-07 11:18:12 +05:30
Continuous Delivery. The difference is that instead of deploying your
2021-03-11 19:13:27 +05:30
application manually, you set it to be deployed automatically.
Human intervention is not required.
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
## GitLab CI/CD
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
[GitLab CI/CD](../quick_start/index.md) is the part of GitLab that you use
for all of the continuous methods (Continuous Integration,
Delivery, and Deployment). With GitLab CI/CD, you can test, build,
and publish your software with no third-party application or integration needed.
2019-07-07 11:18:12 +05:30
2020-05-24 23:13:21 +05:30
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
2021-03-11 19:13:27 +05:30
For an overview, see [Introduction to GitLab CI/CD](https://www.youtube.com/watch?v=l5705U8s_nQ&t=397) from an April 2020 GitLab meetup.
2020-05-24 23:13:21 +05:30
2021-03-11 19:13:27 +05:30
### GitLab CI/CD workflow
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
GitLab CI/CD fits in a common development workflow.
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
You can start by discussing a code implementation in an issue
and working locally on your proposed changes. Then you can push your
commits to a feature branch in a remote repository that's hosted in GitLab.
The push triggers the CI/CD pipeline for your project. Then, GitLab CI/CD:
2019-07-07 11:18:12 +05:30
2021-01-03 14:25:43 +05:30
- Runs automated scripts (sequentially or in parallel) to:
2021-03-11 19:13:27 +05:30
- Build and test your application.
- Preview the changes in a Review App, the same as you
would see on your `localhost`.
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
After the implementation works as expected:
2019-07-07 11:18:12 +05:30
- Get your code reviewed and approved.
- Merge the feature branch into the default branch.
- GitLab CI/CD deploys your changes automatically to a production environment.
2021-03-11 19:13:27 +05:30
If something goes wrong, you can roll back your changes.
2019-07-07 11:18:12 +05:30
2019-07-31 22:56:46 +05:30
![GitLab workflow example](img/gitlab_workflow_example_11_9.png)
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
This workflow shows the major steps in the GitLab process.
You don't need any external tools to deliver your software and
you can visualize all the steps in the GitLab UI.
2019-07-07 11:18:12 +05:30
2021-03-11 19:13:27 +05:30
### A deeper look into the CI/CD workflow
2019-07-31 22:56:46 +05:30
2021-03-11 19:13:27 +05:30
If you look deeper into the workflow, you can see
2019-07-31 22:56:46 +05:30
the features available in GitLab at each stage of the DevOps
2021-03-11 19:13:27 +05:30
lifecycle.
2019-07-31 22:56:46 +05:30
2019-12-04 20:38:33 +05:30
![Deeper look into the basic CI/CD workflow](img/gitlab_workflow_example_extended_v12_3.png)
2019-07-31 22:56:46 +05:30
2019-09-04 21:01:54 +05:30
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
2021-03-11 19:13:27 +05:30
[Get a deeper look at GitLab CI/CD](https://youtu.be/l5705U8s_nQ?t=369).