Auto DevOps

Learn how GitLab Auto DevOps provides a complete CI/CD pipeline out of the box. From auto build and test to security scanning and deployment, understand what it does, how to customize it, and when to use it.

Auto DevOps Deploy GitLab CI/CD
What is Auto DevOps?

Auto DevOps is a pre-configured CI/CD pipeline that GitLab provides out of the box. Instead of writing a .gitlab-ci.yml file, you enable Auto DevOps in your project settings, and GitLab automatically detects your application's language and framework, builds it, runs tests, performs security scans, and deploys it to Kubernetes. The goal is to give every project a production-grade pipeline with zero configuration — a "golden path" that follows best practices by default .

Auto DevOps is built on a set of CI/CD templates that live in GitLab itself. Each template handles one stage of the pipeline: Auto-Build.gitlab-ci.yml, Auto-Test.gitlab-ci.yml, Auto-Deploy.gitlab-ci.yml, and so on. When you enable Auto DevOps, GitLab includes all these templates in your pipeline automatically. The templates use sensible defaults for each language, but every behavior can be customized with CI/CD variables .

Auto DevOps is not for every project. It's designed for applications that follow common conventions — a Node.js app with a package.json, a Python app with a requirements.txt, a Ruby app with a Gemfile. For applications with unusual build requirements, Auto DevOps can be customized, but at some point it's simpler to write your own pipeline. Understanding what Auto DevOps does and when it fits is the key to using it effectively.

Core Principle: Auto DevOps is a starting point, not a straitjacket. Enable it to get a complete pipeline in minutes, then customize the parts that need customization using CI/CD variables.

Auto Build

Detects language, builds a Docker image using Herokuish or Cloud Native Buildpacks, pushes to the registry.

Auto Test

Runs tests based on detected language. Node.js, Python, Ruby, Java, Go, PHP are supported.

Auto Security

Runs SAST, Dependency Scanning, Secret Detection, and Container Scanning automatically.

Auto Code Quality

Runs code quality checks (linting, complexity) and displays results in merge requests.

Auto Deploy

Deploys to Kubernetes using Helm. Creates review apps, staging, and production environments.

Customization

Override any behavior with CI/CD variables. Add your own .gitlab-ci.yml to extend the pipeline.
Enabling Auto DevOps

Enabling Auto DevOps is a two-step process. First, ensure your project has a Kubernetes cluster connected (via the GitLab agent) or that you're using a deployment target Auto DevOps understands. Second, enable Auto DevOps in the project settings: Settings → CI/CD → Auto DevOps → "Default to Auto DevOps pipeline." Once enabled, the next push to the default branch triggers a full Auto DevOps pipeline, and no .gitlab-ci.yml file is needed .

Auto DevOps can be enabled at the project level or inherited from a group or instance. If a group has Auto DevOps enabled by default, every new project in the group gets it automatically. This is useful for organizations that want a consistent baseline across all projects. The setting can be overridden per project if needed.

The first pipeline run is where Auto DevOps detects your language. It looks for well-known files — package.json for Node.js, requirements.txt for Python, Gemfile for Ruby, pom.xml for Java, go.mod for Go — and selects the appropriate build and test templates. If your project doesn't match a known language, Auto DevOps may still work using Herokuish buildpacks, but it's more likely to fail. In that case, customizing or writing your own pipeline is the better path .

# Enabling Auto DevOps (UI) # Project > Settings > CI/CD > Auto DevOps # - Default to Auto DevOps pipeline: ✓ # - Deployment strategy: Continuous deployment to production # or Continuous deployment to production with manual approval # or Timed incremental rollout to production # or Manual deployment to production # Enabling Auto DevOps via API curl --request PUT \ --header "PRIVATE-TOKEN: " \ --url "https://gitlab.example.com/api/v4/projects/:id" \ --data "auto_devops_enabled=true" # Enabling at group level (inherited by new projects) curl --request PUT \ --header "PRIVATE-TOKEN: " \ --url "https://gitlab.example.com/api/v4/groups/:id" \ --data "auto_devops_enabled=true" # Enabling at instance level (admin only) # Admin > Settings > CI/CD > Auto DevOps # What Auto DevOps detects: # - package.json -> Node.js # - requirements.txt -> Python # - Gemfile -> Ruby # - pom.xml -> Java (Maven) # - build.gradle -> Java (Gradle) # - go.mod -> Go # - composer.json -> PHP # - index.html -> Static site # - Dockerfile -> Custom Docker build # If your project doesn't match, Auto DevOps falls back # to Herokuish buildpacks, which may or may not work # After enabling, push a commit to trigger the first pipeline # GitLab will auto-detect and build # To disable Auto DevOps: # Settings > CI/CD > Auto DevOps # - Default to Auto DevOps pipeline: ✗
Auto DevOps Setup Checklist:
  • Connect a Kubernetes cluster (via GitLab agent) or another target
  • Enable Auto DevOps in project settings
  • Ensure your project matches a supported language
  • Set required CI/CD variables (e.g., KUBE_INGRESS_BASE_DOMAIN)
  • Push a commit to trigger the first pipeline
The Auto DevOps Pipeline

When Auto DevOps is enabled, the pipeline consists of several stages, each implemented by one or more templates. The stages are: build, test, code quality, security, review (for merge requests), deploy (staging), and deploy (production). Each stage can be enabled, disabled, or customized independently. The order is fixed (it follows the standard CI/CD flow), but individual jobs within stages can be configured .

The build stage uses either Herokuish (a buildpack-based builder) or Cloud Native Buildpacks to compile the application into a Docker image. If the project has a Dockerfile, it uses that instead. The resulting image is pushed to the GitLab Container Registry. The test stage runs the language-appropriate test suite. The code quality stage runs linting and static analysis. The security stage runs SAST, dependency scanning, and secret detection. The deploy stage uses Helm to deploy to Kubernetes .

For merge requests, Auto DevOps creates a review app — a temporary environment for reviewers to see the changes live. For the default branch, it deploys to staging and, depending on the deployment strategy, either auto-deploys to production or waits for manual approval. The production deployment uses a Helm chart that's bundled with Auto DevOps, but it can be customized. The whole flow is designed to be safe by default: manual approval for production, review apps for MRs, and automatic rollback on failure .

# The Auto DevOps pipeline stages # (auto-generated, no .gitlab-ci.yml needed) stages: - build - test - code_quality - security - review - staging - production - cleanup # Build: creates Docker image # - Uses Herokuish buildpacks or Cloud Native Buildpacks # - Or uses Dockerfile if present # - Pushes to GitLab Container Registry # Test: runs language-specific tests # - Node.js: npm test # - Python: pytest # - Ruby: rspec # - Java: mvn test # - Go: go test # Code Quality: linting and static analysis # - Uses CodeClimate analyzers # - Results displayed in MR # Security: security scans # - SAST (static analysis) # - Dependency Scanning # - Secret Detection # - Container Scanning # - License Scanning # - Results displayed in MR and security dashboard # Review: review app for merge requests # - Deploys a temporary environment # - URL posted in MR # - Destroyed when MR closes # Staging: deploys to staging environment # - Runs on default branch # - Uses Helm chart # Production: deploys to production # - Runs on default branch # - Manual or automatic based on strategy # Cleanup: removes old environments # - Runs on schedules or after deployment # The pipeline is defined by included templates: # include: # - template: Auto-DevOps.gitlab-ci.yml # You can override individual jobs: # include: # - template: Auto-DevOps.gitlab-ci.yml # # variables: # TEST_DISABLED: "true" # Disable test stage # # # Customize build # build: # script: # - echo "My custom build" # - npm run build:custom
Pipeline Stages in Detail: