debian-mirror-gitlab/doc/topics/autodevops/index.md

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

232 lines
9.8 KiB
Markdown
Raw Normal View History

2021-01-29 00:20:46 +05:30
---
stage: Configure
group: Configure
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
2021-01-29 00:20:46 +05:30
---
2021-03-11 19:13:27 +05:30
# Auto DevOps **(FREE)**
2018-03-17 18:26:18 +05:30
2022-01-26 12:08:38 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/38366) in GitLab 11.0.
2022-05-07 20:08:51 +05:30
> - Support for the GitLab agent was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/299350) in GitLab 14.5.
2021-04-17 20:07:23 +05:30
2021-10-27 15:23:28 +05:30
GitLab Auto DevOps is a collection of pre-configured features and integrations
that work together to support your software delivery process.
2021-04-17 20:07:23 +05:30
2022-10-11 01:57:18 +05:30
Auto DevOps detects your programming language and uses [CI/CD templates](https://gitlab.com/gitlab-org/gitlab/-/tree/master/lib/gitlab/ci/templates)
to create and run default pipelines to build and test your application. Then, you can [configure deployments](requirements.md) to deploy your apps to staging
and production, and set up [Review Apps](stages.md#auto-review-apps)
to preview your changes per branch.
2021-04-17 20:07:23 +05:30
2022-10-11 01:57:18 +05:30
You can use default settings to quickly ship your apps, and iterate and [customize](customize.md) later.
You can also [manage Auto DevOps with APIs](customize.md#extend-auto-devops-with-the-api).
2021-04-17 20:07:23 +05:30
2021-03-08 18:12:59 +05:30
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
2021-10-27 15:23:28 +05:30
For an introduction to Auto DevOps, watch [Auto DevOps in GitLab 11.0](https://youtu.be/0Tc0YYBxqi4).
2019-09-04 21:01:54 +05:30
2021-10-27 15:23:28 +05:30
## Auto DevOps features
2021-03-08 18:12:59 +05:30
2022-11-25 23:54:43 +05:30
Auto DevOps supports development during each of the [DevOps stages](stages.md).
| Stage | Auto DevOps feature |
|---------|-------------|
| Build | [Auto Build](stages.md#auto-build) |
| Build | [Auto Dependency Scanning](stages.md#auto-dependency-scanning) |
| Test | [Auto Test](stages.md#auto-test) |
| Test | [Auto Browser Performance Testing](stages.md#auto-browser-performance-testing) |
| Test | [Auto Code Intelligence](stages.md#auto-code-intelligence) |
| Test | [Auto Code Quality](stages.md#auto-code-quality) |
| Test | [Auto Container Scanning](stages.md#auto-container-scanning) |
| Test | [Auto License Compliance](stages.md#auto-license-compliance) |
| Deploy | [Auto Review Apps](stages.md#auto-review-apps) |
| Deploy | [Auto Deploy](stages.md#auto-deploy) |
| Monitor | [Auto Monitoring](stages.md#auto-monitoring) |
| Secure | [Auto Dynamic Application Security Testing (DAST)](stages.md#auto-dast) |
| Secure | [Auto Static Application Security Testing (SAST)](stages.md#auto-sast) |
| Secure | [Auto Secret Detection](stages.md#auto-secret-detection) |
2020-03-13 15:44:24 +05:30
2021-10-27 15:23:28 +05:30
### Comparison to application platforms and PaaS
2021-04-17 20:07:23 +05:30
2021-10-27 15:23:28 +05:30
Auto DevOps provides features often included in an application
platform or in a Platform as a Service (PaaS).
2021-04-17 20:07:23 +05:30
2021-10-27 15:23:28 +05:30
Inspired by [Heroku](https://www.heroku.com/), Auto DevOps goes beyond it
in multiple ways:
2021-04-17 20:07:23 +05:30
2021-10-27 15:23:28 +05:30
- Auto DevOps works with any Kubernetes cluster.
- There is no additional cost.
- You can use a cluster hosted by yourself or on any public cloud.
- Auto DevOps offers an incremental graduation path. If you need to [customize](customize.md), start by changing the templates and evolve from there.
2021-04-17 20:07:23 +05:30
2021-10-27 15:23:28 +05:30
## Get started with Auto DevOps
2021-04-17 20:07:23 +05:30
2021-10-27 15:23:28 +05:30
To get started, you only need to [enable Auto DevOps](#enable-or-disable-auto-devops).
This is enough to run an Auto DevOps pipeline to build and
test your application.
2021-04-17 20:07:23 +05:30
2021-10-27 15:23:28 +05:30
If you want to build, test, and deploy your app:
2020-03-13 15:44:24 +05:30
2021-11-11 11:23:49 +05:30
1. View the [requirements for deployment](requirements.md).
2021-10-27 15:23:28 +05:30
1. [Enable Auto DevOps](#enable-or-disable-auto-devops).
2022-11-25 23:54:43 +05:30
1. [Deploy your app to a cloud provider](#deploy-your-app-to-a-cloud-provider).
2018-11-08 19:23:39 +05:30
2021-10-27 15:23:28 +05:30
### Enable or disable Auto DevOps
2018-12-13 13:39:08 +05:30
2021-10-27 15:23:28 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/41729) in GitLab 11.3, Auto DevOps is enabled by default.
2022-11-25 23:54:43 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/26655) in GitLab 12.7, Auto DevOps runs pipelines automatically only if a [`Dockerfile` or matching buildpack](stages.md#auto-build) exists.
2020-05-24 23:13:21 +05:30
2021-10-27 15:23:28 +05:30
Depending on your instance type, you can enable or disable Auto DevOps at the
following levels:
2018-11-08 19:23:39 +05:30
2021-10-27 15:23:28 +05:30
| Instance type | [Project](#at-the-project-level) | [Group](#at-the-group-level) | [Instance](#at-the-instance-level) (Admin Area) |
|---------------------|------------------------|------------------------|------------------------|
2021-11-18 22:05:49 +05:30
| GitLab SaaS | **{check-circle}** Yes | **{check-circle}** Yes | **{dotted-circle}** No |
2021-10-27 15:23:28 +05:30
| GitLab self-managed | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
2018-10-15 14:42:47 +05:30
2021-10-27 15:23:28 +05:30
Before enabling Auto DevOps, consider [preparing it for deployment](requirements.md). If you don't, Auto DevOps can build and test your app,
but cannot deploy it.
2018-10-15 14:42:47 +05:30
2021-10-27 15:23:28 +05:30
#### At the project level
2018-10-15 14:42:47 +05:30
2021-10-27 15:23:28 +05:30
To use Auto DevOps for individual projects, you can enable it in a
project-by-project basis. If you intend to use it for more projects,
you can enable it for a [group](#at-the-group-level) or an
[instance](#at-the-instance-level). This can save you the time of
2022-11-25 23:54:43 +05:30
enabling it in each project.
2018-03-17 18:26:18 +05:30
2022-10-11 01:57:18 +05:30
Prerequisites:
2021-02-22 17:27:13 +05:30
2022-10-11 01:57:18 +05:30
- You must have at least the Maintainer role for the project.
- Ensure your project does not have a `.gitlab-ci.yml` present. If present, your CI/CD configuration takes
precedence over the Auto DevOps pipeline.
2018-03-17 18:26:18 +05:30
2021-10-27 15:23:28 +05:30
To enable Auto DevOps for a project:
2018-03-17 18:26:18 +05:30
2022-10-11 01:57:18 +05:30
1. On the top bar, select **Main menu > Projects** and find your project.
2021-11-11 11:23:49 +05:30
1. On the left sidebar, select **Settings > CI/CD**.
1. Expand **Auto DevOps**.
1. Select the **Default to Auto DevOps pipeline** checkbox.
1. Optional but recommended. Add the [base domain](requirements.md#auto-devops-base-domain).
1. Optional but recommended. Choose the [deployment strategy](requirements.md#auto-devops-deployment-strategy).
2021-10-27 15:23:28 +05:30
1. Select **Save changes**.
2018-03-17 18:26:18 +05:30
2021-10-27 15:23:28 +05:30
GitLab triggers the Auto DevOps pipeline on the default branch.
2018-03-17 18:26:18 +05:30
2021-11-11 11:23:49 +05:30
To disable it, follow the same process and clear the
**Default to Auto DevOps pipeline** checkbox.
2018-03-17 18:26:18 +05:30
2021-10-27 15:23:28 +05:30
#### At the group level
2018-03-17 18:26:18 +05:30
2021-10-27 15:23:28 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/52447) in GitLab 11.10.
2019-10-12 21:52:04 +05:30
2022-11-25 23:54:43 +05:30
When you enable Auto DevOps at the group level, the subgroups and
projects in that group inherit the configuration. You can save time by
enabling Auto DevOps for a group instead of enabling it for each
subgroup or project.
2020-07-28 23:09:34 +05:30
2021-10-27 15:23:28 +05:30
When enabled for a group, you can still disable Auto DevOps
for the subgroups and projects where you don't want to use it.
2020-07-28 23:09:34 +05:30
2022-10-11 01:57:18 +05:30
Prerequisites:
2023-03-04 22:38:38 +05:30
- You must have the Owner role for the group.
2018-03-17 18:26:18 +05:30
2021-10-27 15:23:28 +05:30
To enable Auto DevOps for a group:
2020-05-24 23:13:21 +05:30
2022-10-11 01:57:18 +05:30
1. On the top bar, select **Main menu > Groups** and find your group.
2021-11-11 11:23:49 +05:30
1. On the left sidebar, select **Settings > CI/CD**.
1. Expand **Auto DevOps**.
1. Select the **Default to Auto DevOps pipeline** checkbox.
2021-10-27 15:23:28 +05:30
1. Select **Save changes**.
2019-03-02 22:35:43 +05:30
2022-11-25 23:54:43 +05:30
To disable Auto DevOps at the group level, follow the same process and
2021-11-11 11:23:49 +05:30
clear the **Default to Auto DevOps pipeline** checkbox.
2021-10-27 15:23:28 +05:30
After enabling Auto DevOps at the group level, you can trigger the
2022-10-11 01:57:18 +05:30
Auto DevOps pipeline for any project that belongs to that group:
2018-03-17 18:26:18 +05:30
2022-10-11 01:57:18 +05:30
1. On the top bar, select **Main menu > Projects** and find your project.
2021-10-27 15:23:28 +05:30
1. Make sure the project doesn't contain a `.gitlab-ci.yml` file.
2021-11-11 11:23:49 +05:30
1. On the left sidebar, select **CI/CD > Pipelines**.
1. To trigger the Auto DevOps pipeline, select **Run pipeline**.
2018-03-17 18:26:18 +05:30
2021-10-27 15:23:28 +05:30
#### At the instance level **(FREE SELF)**
2018-03-17 18:26:18 +05:30
2022-11-25 23:54:43 +05:30
To enable Auto DevOps by default for all projects, you can enable it at the instance level.
You can still disable Auto DevOps for each group and project
where you don't want to run it.
2018-10-15 14:42:47 +05:30
2022-10-11 01:57:18 +05:30
Even when disabled for an instance, group Owners and project Maintainers
2021-10-27 15:23:28 +05:30
can still enable Auto DevOps at the group and project levels.
2020-07-28 23:09:34 +05:30
2022-10-11 01:57:18 +05:30
Prerequisites:
- You must be an administrator for the instance.
2021-10-27 15:23:28 +05:30
To enable Auto DevOps for your instance:
2020-07-28 23:09:34 +05:30
2022-10-11 01:57:18 +05:30
1. On the top bar, select **Main menu > Admin**.
2021-11-11 11:23:49 +05:30
1. On the left sidebar, select **Settings > CI/CD**.
1. Expand **Auto DevOps**.
1. Select the **Default to Auto DevOps pipeline** checkbox.
1. Optional. Add the Auto DevOps [base domain](requirements.md#auto-devops-base-domain).
2021-10-27 15:23:28 +05:30
1. Select **Save changes**.
2019-12-26 22:10:19 +05:30
2022-11-25 23:54:43 +05:30
When enabled, Auto DevOps attempts to run pipelines in every project. If the
2021-10-27 15:23:28 +05:30
pipeline fails in a particular project, it disables itself.
GitLab administrators can change this in the [Auto DevOps settings](../../user/admin_area/settings/continuous_integration.md#auto-devops).
2019-12-26 22:10:19 +05:30
2021-10-27 15:23:28 +05:30
If a [CI/CD configuration file](../../ci/yaml/index.md) is present,
2022-11-25 23:54:43 +05:30
it remains unchanged and Auto DevOps does not affect it.
2019-12-26 22:10:19 +05:30
2021-10-27 15:23:28 +05:30
To disable Auto DevOps in the instance level, follow the same process
2021-11-11 11:23:49 +05:30
and clear the **Default to Auto DevOps pipeline** checkbox.
2019-12-26 22:10:19 +05:30
2022-11-25 23:54:43 +05:30
### Deploy your app to a cloud provider
2019-12-26 22:10:19 +05:30
2022-07-23 23:45:48 +05:30
- [Use Auto DevOps to deploy to a Kubernetes cluster on Google Kubernetes Engine (GKE)](cloud_deployments/auto_devops_with_gke.md)
- [Use Auto DevOps to deploy to EC2](cloud_deployments/auto_devops_with_ec2.md)
- [Use Auto DevOps to deploy to ECS](cloud_deployments/auto_devops_with_ecs.md)
2019-12-26 22:10:19 +05:30
2021-10-27 15:23:28 +05:30
## Upgrade Auto DevOps dependencies when updating GitLab
2019-12-26 22:10:19 +05:30
2022-11-25 23:54:43 +05:30
When updating GitLab, you might need to upgrade Auto DevOps dependencies to
2021-10-27 15:23:28 +05:30
match your new GitLab version:
2021-03-08 18:12:59 +05:30
2021-10-27 15:23:28 +05:30
- [Upgrading Auto DevOps resources](upgrading_auto_deploy_dependencies.md):
- Auto DevOps template.
- Auto Deploy template.
- Auto Deploy image.
- Helm.
- Kubernetes.
- Environment variables.
- [Upgrading PostgreSQL](upgrading_postgresql.md).
2018-03-17 18:26:18 +05:30
2022-11-25 23:54:43 +05:30
## Private registry support
There is no guarantee that you can use a private container registry with Auto DevOps.
Instead, use the [GitLab Container Registry](../../user/packages/container_registry/index.md) with Auto DevOps to
simplify configuration and prevent any unforeseen issues.
2022-10-11 01:57:18 +05:30
## Install applications behind a proxy
2019-12-04 20:38:33 +05:30
2021-02-22 17:27:13 +05:30
The GitLab integration with Helm does not support installing applications when
2021-10-27 15:23:28 +05:30
behind a proxy.
2022-11-25 23:54:43 +05:30
If you want to do so, you must inject proxy settings into the
installation pods at runtime.
## Related topics
- [Continuous methodologies](../../ci/introduction/index.md)
- [Docker](https://docs.docker.com)
- [GitLab Runner](https://docs.gitlab.com/runner/)
- [Helm](https://helm.sh/docs/)
- [Kubernetes](https://kubernetes.io/docs/home/)
- [Prometheus](https://prometheus.io/docs/introduction/overview/)
2019-12-04 20:38:33 +05:30
2021-09-30 23:02:18 +05:30
## Troubleshooting
See [troubleshooting Auto DevOps](troubleshooting.md).