GitLab Auto DevOps can automate your entire CI/CD pipeline, but it’s not magic; it’s a series of integrated tools that need to be understood to be effectively leveraged.

Let’s see Auto DevOps in action. Imagine a developer pushes a new commit to a GitLab repository.

git commit -m "Add new feature"
git push origin main

GitLab detects this push and kicks off the Auto DevOps pipeline.

The first stage is typically build. Auto DevOps intelligently detects the application’s language and framework. For a Node.js app, it might run:

npm install && npm run build

For a Python app:

pip install -r requirements.txt

It then packages the application into a Docker image, tagging it with the commit SHA. This image is pushed to GitLab’s Container Registry.

Next, test. Auto DevOps attempts to run various tests based on detected frameworks. For a Rails app, it might run rspec. For a Java app, mvn test.

Then comes deploy. Auto DevOps, by default, attempts to deploy to Kubernetes. It uses Helm to manage the deployment. A basic gitlab-ci.yml might look like this, though Auto DevOps often infers most of this:

include:
  - template: Auto-DevOps.gitlab-ci.yml

GitLab will provision a Kubernetes deployment, service, and ingress. It will automatically generate a temporary URL for the deployed application, allowing for immediate review.

The staging environment is automatically created and deployed to. You can then promote this to production with a manual click in the GitLab UI.

The review stage is particularly powerful. For every merge request, a temporary Kubernetes environment is spun up with the changes. This allows for easy review and testing of new features before merging.

The canary and performance stages can also be enabled. canary deploys a small percentage of traffic to the new version, while performance runs load tests against the application.

The whole process is orchestrated by GitLab CI/CD, triggered by your Git commits. The gitlab-ci.yml file is the central piece, but Auto DevOps provides a robust default template that often requires minimal customization.

The most surprising true thing about Auto DevOps is its ability to infer build, test, and deploy strategies for a vast array of languages and frameworks without explicit configuration, treating your application as a first-class citizen in a generalized pipeline.

What most people don’t realize is that while Auto DevOps provides sensible defaults, the underlying tools (Docker, Helm, Kubernetes, etc.) are fully configurable. You can override default commands, specify custom Dockerfiles, provide your own Helm charts, and even integrate external testing tools. The gitlab-ci.yml file, even with the Auto DevOps template included, acts as a powerful override mechanism. For example, to use a custom Dockerfile, you’d add:

build:
  script:
    - docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA" .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
  variables:
    DOCKER_BUILD_CONTEXT: "."

This allows you to maintain the benefits of automation while retaining fine-grained control over specific aspects of your build and deployment process.

The next concept you’ll likely grapple with is managing multiple environments (staging, production, etc.) and implementing more sophisticated deployment strategies beyond a simple rolling update.

Want structured learning?

Take the full Gitlab course →