debian-mirror-gitlab/doc/ci/README.md

129 lines
10 KiB
Markdown
Raw Normal View History

2018-03-17 18:26:18 +05:30
---
comments: false
2018-11-08 19:23:39 +05:30
description: "Learn how to use GitLab CI/CD, the GitLab built-in Continuous Integration, Continuous Deployment, and Continuous Delivery toolset to build, test, and deploy your application."
2018-03-17 18:26:18 +05:30
---
# GitLab Continuous Integration (GitLab CI/CD)
2015-09-25 12:07:36 +05:30
2019-05-18 00:54:41 +05:30
GitLab CI/CD is GitLab's built-in tool for software development using continuous methodology:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
- Continuous integration (CI).
- Continuous delivery and deployment (CD).
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
Within the [DevOps lifecycle](../README.md#the-entire-devops-lifecycle), GitLab CI/CD spans
the [Verify (CI)](../README.md#verify) and [Release (CD)](../README.md#release) stages.
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
## Overview
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
CI/CD is a vast area, so GitLab provides documentation for all levels of expertise. Consult the following table to find the right documentation for you:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
| Level of expertise | Resource |
|:------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|
| New to the concepts of CI and CD | For a high-level overview, read an [introduction to CI/CD with GitLab](introduction/index.md). |
| Familiar with GitLab CI/CD concepts | After getting familiar with GitLab CI/CD, let us walk you through a simple example in our [getting started guide](quick_start/README.md). |
| A GitLab CI/CD expert | Jump straight to our [`.gitlab.yml`](yaml/README.md) reference. |
2018-03-17 18:26:18 +05:30
2019-05-18 00:54:41 +05:30
Familiarity with GitLab Runner is also useful because it is responsible for running the jobs in your
CI/CD pipeline. On GitLab.com, shared Runners are enabled by default so you won't need to set this up to get started.
2018-03-17 18:26:18 +05:30
2019-05-18 00:54:41 +05:30
## CI/CD with Auto DevOps
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
[Auto DevOps](../topics/autodevops/index.md) is the default minimum-configuration method for
implementing CI/CD. Auto DevOps:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
- Provides simplified setup and execution of CI/CD.
- Allows GitLab to automatically detect, build, test, deploy, and monitor your applications.
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
## Manually configured CI/CD
2018-03-17 18:26:18 +05:30
2019-05-18 00:54:41 +05:30
For complete control, you can manually configure GitLab CI/CD.
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
### Usage
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
With basic knowledge of how GitLab CI/CD works, the following documentation extends your knowledge
into more features:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
| Topic | Description |
|:--------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------|
| [Creating and using CI/CD pipelines](pipelines.md) | Understand, visualize, create, and use CI/CD pipelines. |
| [CI/CD Variables](variables/README.md) | How environment variables can be configured and made available in pipelines. |
| [Where variables can be used](variables/where_variables_can_be_used.md) | A deeper look into where and how CI/CD variables can be used. |
| [User](../user/permissions.md#gitlab-cicd-permissions) and [job](../user/permissions.md#job-permissions) permissions | Learn about the access levels a user can have for performing certain CI actions. |
| [Configuring GitLab Runners](runners/README.md) | Documentation for configuring [GitLab Runner](https://docs.gitlab.com/runner/). |
| [Environments and deployments](environments.md) | Deploy the output of jobs into environments for reviewing, staging, and production. |
| [Job artifacts](../user/project/pipelines/job_artifacts.md) | Learn about the output of jobs. |
| [Cache dependencies in GitLab CI/CD](caching/index.md) | Discover how to speed up pipelines using caching. |
| [Using Git submodules with GitLab CI](git_submodules.md) | How to run your CI jobs when using Git submodules. |
| [Pipelines for merge requests](merge_request_pipelines/index.md) | Create pipelines specifically for merge requests. |
| [Using SSH keys with GitLab CI/CD](ssh_keys/README.md) | Use SSH keys in your build environment. |
| [Triggering pipelines through the API](triggers/README.md) | Use the GitLab API to trigger a pipeline. |
| [Pipeline schedules](../user/project/pipelines/schedules.md) | Trigger pipelines on a schedule. |
| [Connecting GitLab with a Kubernetes cluster](../user/project/clusters/index.md) | Integrate one or more Kubernetes clusters to your project. |
| [ChatOps](chatops/README.md) | Trigger CI jobs from chat, with results sent back to the channel. |
| [Interactive web terminals](interactive_web_terminal/index.md) | Open an interactive web terminal to debug the running jobs. |
| [Review Apps](review_apps/index.md) | Configure GitLab CI/CD to preview code changes in a per-branch basis. |
| [Optimizing GitLab for large repositories](large_repositories/index.md) | Useful tips on how to optimize GitLab and GitLab Runner for big repositories. |
| [Deploy Boards](https://docs.gitlab.com/ee/user/project/deploy_boards.html) **[PREMIUM]** | Check the current health and status of each CI/CD environment running on Kubernetes. |
| [GitLab CI/CD for external repositories](https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/index.html) **[PREMIUM]** | Get the benefits of GitLab CI/CD combined with repositories in GitHub and BitBucket Cloud. |
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
### GitLab Pages
2018-03-17 18:26:18 +05:30
2019-05-18 00:54:41 +05:30
GitLab CI/CD can be used to build and host static websites. For more information, see the
documentation on [GitLab Pages](../user/project/pages/index.md),
or dive right into the [CI/CD step-by-step guide for Pages](../user/project/pages/getting_started_part_four.md).
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
### Examples
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
GitLab provides examples of configuring GitLab CI/CD in the form of:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
- A collection of [examples and other resources](examples/README.md).
- Example projects that are available at the [`gitlab-examples`](https://gitlab.com/gitlab-examples) group. For example, see:
- [`multi-project-pipelines`](https://gitlab.com/gitlab-examples/multi-project-pipelines) for examples of implementing multi-project pipelines.
- [`review-apps-nginx`](https://gitlab.com/gitlab-examples/review-apps-nginx/) provides an example of using Review Apps.
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
### Administration
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
As a GitLab administrator, you can change the default behavior of GitLab CI/CD for:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
- An [entire GitLab instance](../user/admin_area/settings/continuous_integration.md).
- Specific projects, using [pipelines settings](../user/project/pipelines/settings.md).
2018-03-17 18:26:18 +05:30
2019-05-18 00:54:41 +05:30
See also:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
- [How to enable or disable GitLab CI/CD](enable_or_disable_ci.md).
- Other [CI administration settings](../administration/index.md#continuous-integration-settings).
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
### Using Docker
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
Docker is commonly used with GitLab CI/CD. Learn more about how to to accomplish this with the following
documentation:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
| Topic | Description |
|:-------------------------------------------------------------------------|:-------------------------------------------------------------------------|
| [Using Docker images](docker/using_docker_images.md) | Use GitLab and GitLab Runner with Docker to build and test applications. |
| [Building Docker images with GitLab CI/CD](docker/using_docker_build.md) | Maintain Docker-based projects using GitLab CI/CD. |
2018-03-17 18:26:18 +05:30
2019-05-18 00:54:41 +05:30
Related topics include:
2017-08-17 22:00:37 +05:30
2019-05-18 00:54:41 +05:30
- [Docker integration](docker/README.md).
- [CI services (linked Docker containers)](services/README.md).
## Why GitLab CI/CD?
The following articles explain reasons to use GitLab CI/CD for your CI/CD infrastructure:
- [Why we chose GitLab CI for our CI/CD solution](https://about.gitlab.com/2016/10/17/gitlab-ci-oohlala/)
- [Building our web-app on GitLab CI](https://about.gitlab.com/2016/07/22/building-our-web-app-on-gitlab-ci/)
See also the [Why CI/CD?](https://docs.google.com/presentation/d/1OGgk2Tcxbpl7DJaIOzCX4Vqg3dlwfELC3u2jEeCBbDk) presentation.
2017-08-17 22:00:37 +05:30
## Breaking changes
2019-05-18 00:54:41 +05:30
As GitLab CI/CD has evolved, certain breaking changes have been necessary. These are:
- [CI variables renaming for GitLab 9.0](variables/deprecated_variables.md#gitlab-90-renamed-variables). Read about the
2017-08-17 22:00:37 +05:30
deprecated CI variables and what you should use for GitLab 9.0+.
2019-05-18 00:54:41 +05:30
- [New CI job permissions model](../user/project/new_ci_build_permissions_model.md).
See what changed in GitLab 8.12 and how that affects your jobs.
2017-08-17 22:00:37 +05:30
There's a new way to access your Git submodules and LFS objects in jobs.