2020-10-30 17:08:52 -04:00
---
2020-11-16 13:09:15 -05:00
stage: Configure
group: Configure
2020-11-26 01:09:20 -05:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-10-30 17:08:52 -04:00
---
2021-02-08 13:09:49 -05:00
# Auto DevOps **(FREE)**
2017-09-07 16:39:09 -04:00
2021-11-18 07:13:46 -05:00
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/38366) in GitLab 11.0.
2021-12-09 16:11:06 -05:00
> - Support for the GitLab Agent was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/299350) in GitLab 14.5.
2017-09-21 09:33:59 -04:00
2021-07-28 05:09:47 -04:00
GitLab Auto DevOps is a collection of pre-configured features and integrations
that work together to support your software delivery process.
2017-09-07 16:39:09 -04:00
2021-07-28 05:09:47 -04:00
Auto DevOps features and integrations:
2017-09-07 16:39:09 -04:00
2021-07-28 05:09:47 -04:00
- Detect your code's language.
- Build and test your application.
- Measure code quality.
- Scan for vulnerabilities and security flaws.
- Check for licensing issues.
- Monitor in real time.
2021-02-19 13:10:51 -05:00
- Deploy your application.
2020-04-23 20:09:28 -04:00
2021-01-06 01:10:11 -05:00
< i class = "fa fa-youtube-play youtube" aria-hidden = "true" > < / i >
2021-07-28 05:09:47 -04:00
For an introduction to Auto DevOps, watch [Auto DevOps in GitLab 11.0 ](https://youtu.be/0Tc0YYBxqi4 ).
2019-06-12 00:56:08 -04:00
2021-07-28 05:09:47 -04:00
## Auto DevOps features
2021-01-06 01:10:11 -05:00
2021-07-28 05:09:47 -04:00
Based on the DevOps [stages ](stages.md ), use Auto DevOps to:
2020-06-08 14:08:27 -04:00
2021-07-28 05:09:47 -04:00
**Build your app:**
2019-06-11 13:20:41 -04:00
2021-07-28 05:09:47 -04:00
- [Auto Build ](stages.md#auto-build )
- [Auto Dependency Scanning ](stages.md#auto-dependency-scanning )
2019-12-24 01:07:56 -05:00
2021-07-28 05:09:47 -04:00
**Test your app:**
2020-12-01 16:09:29 -05:00
2021-07-28 05:09:47 -04:00
- [Auto Test ](stages.md#auto-test )
- [Auto Browser Performance Testing ](stages.md#auto-browser-performance-testing )
- [Auto Code Intelligence ](stages.md#auto-code-intelligence )
- [Auto Code Quality ](stages.md#auto-code-quality )
- [Auto Container Scanning ](stages.md#auto-container-scanning )
- [Auto License Compliance ](stages.md#auto-license-compliance )
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
**Deploy your app:**
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
- [Auto Review Apps ](stages.md#auto-review-apps )
- [Auto Deploy ](stages.md#auto-deploy )
2019-12-24 01:07:56 -05:00
2021-07-28 05:09:47 -04:00
**Monitor your app:**
2019-12-24 01:07:56 -05:00
2021-07-28 05:09:47 -04:00
- [Auto Monitoring ](stages.md#auto-monitoring )
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
**Secure your app:**
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
- [Auto Dynamic Application Security Testing (DAST) ](stages.md#auto-dast )
- [Auto Static Application Security Testing (SAST) ](stages.md#auto-sast )
- [Auto Secret Detection ](stages.md#auto-secret-detection )
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
### How it works
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
Auto DevOps detects your code language and uses [CI/CD templates ](https://gitlab.com/gitlab-org/gitlab/-/tree/master/lib/gitlab/ci/templates )
to create and run default pipelines. All you need to kick it off is to
[enable ](#enable-or-disable-auto-devops ) it.
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
Auto DevOps starts by building and testing your application. Then, based on your
[predefined deployment configuration ](requirements.md ),
creates the necessary jobs to deploy your apps to staging
and/or production. It also sets up [Review Apps ](stages.md#auto-review-apps )
so that you can preview your changes in a per-branch basis.
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
Note that you don't need to set up the deployment upfront. Auto DevOps
still builds and tests your application. You can define the deployment later.
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
Auto DevOps avoids the hassle of having to create entire pipelines manually.
Keep it simple and facilitate an iterative approach: ship your app first,
then explore the [customizations ](customize.md ) later.
You can also [manage Auto DevOps with APIs ](customize.md#extend-auto-devops-with-the-api ).
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
Some of the benefits of using Auto DevOps as part of your workflow are:
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
- Consistency: always start from default templates.
- Simplicity: create your pipeline with the default settings first, iterate later.
- Productivity: deploy multiple apps in a short period of time.
- Efficiency: get things done fast.
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
### Comparison to application platforms and PaaS
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
Auto DevOps provides features often included in an application
platform or in a Platform as a Service (PaaS).
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
Inspired by [Heroku ](https://www.heroku.com/ ), Auto DevOps goes beyond it
in multiple ways:
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
- 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-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
## Get started with Auto DevOps
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
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-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
If you want to build, test, and deploy your app:
2021-03-08 13:09:12 -05:00
2021-08-20 17:10:36 -04:00
1. View the [requirements for deployment ](requirements.md ).
2021-07-28 05:09:47 -04:00
1. [Enable Auto DevOps ](#enable-or-disable-auto-devops ).
1. Follow the [quick start guide ](#quick-start ).
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
As Auto DevOps relies on many components, be familiar with:
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
- [Continuous methodologies ](../../ci/introduction/index.md )
- [Docker ](https://docs.docker.com )
- [GitLab Runner ](https://docs.gitlab.com/runner/ )
2021-03-08 13:09:12 -05:00
2021-07-28 05:09:47 -04:00
When deploying to a Kubernetes cluster make sure you're also familiar with:
2018-09-14 09:17:19 -04:00
2021-07-28 05:09:47 -04:00
- [Kubernetes ](https://kubernetes.io/docs/home/ )
- [Helm ](https://helm.sh/docs/ )
- [Prometheus ](https://prometheus.io/docs/introduction/overview/ )
2018-06-12 06:38:10 -04:00
2021-07-28 05:09:47 -04:00
### Enable or disable Auto DevOps
2018-10-24 11:59:04 -04:00
2021-07-28 05:09:47 -04:00
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/41729) in GitLab 11.3, Auto DevOps is enabled by default.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/26655) GitLab 12.7, Auto DevOps runs pipelines automatically only if a [`Dockerfile` or matching buildpack](stages.md#auto-build) exists.
2018-06-12 06:38:10 -04:00
2021-07-28 05:09:47 -04:00
Depending on your instance type, you can enable or disable Auto DevOps at the
following levels:
2020-05-17 20:08:13 -04:00
2021-07-28 05:09:47 -04:00
| Instance type | [Project ](#at-the-project-level ) | [Group ](#at-the-group-level ) | [Instance ](#at-the-instance-level ) (Admin Area) |
|---------------------|------------------------|------------------------|------------------------|
2021-10-13 08:12:20 -04:00
| GitLab SaaS | ** {check-circle}** Yes | ** {check-circle}** Yes | ** {dotted-circle}** No |
2021-07-28 05:09:47 -04:00
| GitLab self-managed | ** {check-circle}** Yes | ** {check-circle}** Yes | ** {check-circle}** Yes |
2018-04-10 08:18:58 -04:00
2021-07-28 05:09:47 -04:00
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-04-10 08:18:58 -04:00
2021-07-28 05:09:47 -04:00
#### At the project level
2018-04-10 08:18:58 -04:00
2021-07-28 05:09:47 -04:00
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
enabling it one by one.
2017-09-07 16:39:09 -04:00
2021-07-28 05:09:47 -04:00
Only project Maintainers can enable or disable Auto DevOps at the project level.
2020-12-16 16:09:57 -05:00
2021-07-28 05:09:47 -04:00
Before enabling Auto DevOps, ensure that your project does not have a
`.gitlab-ci.yml` present. If present, your CI/CD configuration takes
precedence over the Auto DevOps pipeline.
2017-09-07 16:39:09 -04:00
2021-07-28 05:09:47 -04:00
To enable Auto DevOps for a project:
2017-09-07 16:39:09 -04:00
2021-08-20 17:10:36 -04:00
1. On the top bar, select **Menu > Projects** and find your project.
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-07-28 05:09:47 -04:00
1. Select **Save changes** .
2017-09-07 16:39:09 -04:00
2021-07-28 05:09:47 -04:00
GitLab triggers the Auto DevOps pipeline on the default branch.
2017-09-07 16:39:09 -04:00
2021-08-20 17:10:36 -04:00
To disable it, follow the same process and clear the
**Default to Auto DevOps pipeline** checkbox.
2017-09-07 16:39:09 -04:00
2021-07-28 05:09:47 -04:00
#### At the group level
2018-01-15 13:11:02 -05:00
2021-07-28 05:09:47 -04:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/52447) in GitLab 11.10.
2019-07-29 06:23:29 -04:00
2021-07-28 05:09:47 -04:00
When you enable Auto DevOps at group level, the subgroups and projects in that
group inherit the configuration. This saves you time by batch-enabling it
rather than enabling individually for each subgroup or project.
2020-07-07 14:09:24 -04:00
2021-07-28 05:09:47 -04:00
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-07 14:09:24 -04:00
2021-07-28 05:09:47 -04:00
Only GitLab administrators and group owners can enable or disable Auto DevOps
at the group level.
2017-09-21 09:33:59 -04:00
2021-07-28 05:09:47 -04:00
To enable Auto DevOps for a group:
2020-04-28 23:09:39 -04:00
2021-08-20 17:10:36 -04:00
1. On the top bar, select **Menu > Groups** and find your group.
1. On the left sidebar, select **Settings > CI/CD** .
1. Expand **Auto DevOps** .
1. Select the **Default to Auto DevOps pipeline** checkbox.
2021-07-28 05:09:47 -04:00
1. Select **Save changes** .
2019-01-28 14:42:17 -05:00
2021-08-20 17:10:36 -04:00
To disable Auto DevOps on the group level, follow the same process and
clear the **Default to Auto DevOps pipeline** checkbox.
2021-07-28 05:09:47 -04:00
After enabling Auto DevOps at the group level, you can trigger the
Auto DevOps pipeline for any project that belongs to that group. To do so:
2018-06-07 09:08:43 -04:00
2021-08-20 17:10:36 -04:00
1. On the top bar, select **Menu > Projects** and find your project.
2021-07-28 05:09:47 -04:00
1. Make sure the project doesn't contain a `.gitlab-ci.yml` file.
2021-08-20 17:10:36 -04:00
1. On the left sidebar, select **CI/CD > Pipelines** .
1. To trigger the Auto DevOps pipeline, select **Run pipeline** .
2017-09-21 09:33:59 -04:00
2021-07-28 05:09:47 -04:00
#### At the instance level **(FREE SELF)**
2017-09-21 09:33:59 -04:00
2021-07-28 05:09:47 -04:00
By enabling Auto DevOps in the instance level, all projects created in that
instance become enabled. This is convenient when you want to run Auto DevOps by
default for all projects. You can still disable Auto DevOps individually for
the groups and projects where you don't want to run it.
2018-04-27 10:50:15 -04:00
2021-07-28 05:09:47 -04:00
Only GitLab administrators can enable or disable Auto DevOps in the instance
level.
2017-09-07 16:39:09 -04:00
2021-07-28 05:09:47 -04:00
Even when disabled for an instance, group owners and project maintainers
can still enable Auto DevOps at the group and project levels.
2020-07-07 14:09:24 -04:00
2021-07-28 05:09:47 -04:00
To enable Auto DevOps for your instance:
2020-07-07 14:09:24 -04:00
2021-08-26 05:11:15 -04:00
1. On the top bar, select **Menu > Admin** .
2021-08-20 17:10:36 -04:00
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-07-28 05:09:47 -04:00
1. Select **Save changes** .
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
When enabled, it attempts to run Auto DevOps pipelines in every project. If the
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-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
If a [CI/CD configuration file ](../../ci/yaml/index.md ) is present,
it remains unchanged and Auto DevOps doesn't affect it.
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
To disable Auto DevOps in the instance level, follow the same process
2021-08-20 17:10:36 -04:00
and clear the **Default to Auto DevOps pipeline** checkbox.
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
### Quick start
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
To guide your through the process of setting up Auto DevOps to deploy to a Kubernetes cluster on
Google Kubernetes Engine (GKE), see the [quick start guide ](quick_start_guide.md ).
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
You can also follow the quick start for the general steps, but deploy to
[AWS ECS ](requirements.md#auto-devops-requirements-for-amazon-ecs ) instead.
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
If you're a self-managed user, before deploying to GKE, a GitLab administrator needs to:
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
1. Configure the [Google OAuth 2.0 OmniAuth Provider ](../../integration/google.md ).
1. Configure a cluster on GKE.
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
## Upgrade Auto DevOps dependencies when updating GitLab
2019-10-31 11:06:41 -04:00
2021-07-28 05:09:47 -04:00
When updating GitLab, you may need to upgrade Auto DevOps dependencies to
match your new GitLab version:
2021-01-04 13:10:11 -05:00
2021-07-28 05:09:47 -04:00
- [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 ).
2017-09-21 09:33:59 -04:00
2021-07-28 05:09:47 -04:00
## Limitations
2017-09-21 09:33:59 -04:00
2019-07-31 23:01:56 -04:00
### Private registry support
2021-07-28 05:09:47 -04:00
We cannot guarantee that you can use a private container registry with Auto DevOps.
We strongly advise you to use GitLab Container Registry with Auto DevOps to
2019-07-31 23:01:56 -04:00
simplify configuration and prevent any unforeseen issues.
2020-07-07 20:09:06 -04:00
### Install applications behind a proxy
2019-09-16 23:06:07 -04:00
2020-12-10 16:10:15 -05:00
The GitLab integration with Helm does not support installing applications when
2021-07-28 05:09:47 -04:00
behind a proxy.
To do so, inject proxy settings into the installation pods at runtime.
For example, you can use a [`PodPreset` ](https://v1-19.docs.kubernetes.io/docs/concepts/workloads/pods/podpreset/ ):
2019-09-16 23:06:07 -04:00
2020-04-27 23:09:53 -04:00
```yaml
2019-09-16 23:06:07 -04:00
apiVersion: settings.k8s.io/v1alpha1
kind: PodPreset
metadata:
name: gitlab-managed-apps-default-proxy
namespace: gitlab-managed-apps
spec:
2020-10-02 02:08:27 -04:00
env:
2019-09-16 23:06:07 -04:00
- name: http_proxy
value: "PUT_YOUR_HTTP_PROXY_HERE"
- name: https_proxy
value: "PUT_YOUR_HTTPS_PROXY_HERE"
```
2021-02-22 13:10:55 -05:00
2021-07-15 08:09:01 -04:00
## Troubleshooting
See [troubleshooting Auto DevOps ](troubleshooting.md ).