Skip to main content
GitLab CI
CHAPTER 01

Introduction to GitLab CI/CD

Updated: May 15, 2026
15 min read

# CHAPTER 1

Introduction to GitLab CI/CD

1. Introduction

In the modern era of software development, writing code is only half the battle. Delivering that code to users safely, quickly, and consistently is where true engineering takes place. Enter CI/CD (Continuous Integration and Continuous Deployment), the engine room of DevOps. While many tools exist to manage code, GitLab stands out as a unique platform because it combines source code management (like GitHub) with a massively powerful, built-in CI/CD engine. In this chapter, we will demystify the DevOps terminology, explore the GitLab ecosystem, and understand why automating your deployment pipeline is no longer optional for professional teams.

2. Learning Objectives

By the end of this chapter, you will be able to:
  • Define Continuous Integration (CI) and Continuous Deployment (CD).
  • Understand the core philosophy of DevOps.
  • Differentiate between GitLab the code host and GitLab CI/CD the automation engine.
  • Navigate the GitLab User Interface.
  • Create a new GitLab account and initialize a repository.

3. Beginner Explanation

Imagine you are building a custom car in your garage.
  • The Old Way: You build the engine, drop it in the car, and hope it starts. When you want to paint the car, you do it yourself by hand. When you want to sell the car, you drive it to the dealership yourself. It is slow, and if you make a mistake, the car is ruined.
  • CI/CD (The Factory):
  • CI (Continuous Integration): As soon as you build a single engine part, a robot takes it, puts it on a testing machine, and runs it at 10,000 RPM. If it breaks, a red alarm sounds instantly so you can fix it before building the rest of the car.
  • CD (Continuous Deployment): Once the robot verifies the engine is perfect, another robot automatically installs it, paints the car, and puts the car on a truck headed straight to the dealership.

GitLab CI/CD is the factory of robots. You just write the code; the robots test it and ship it.

4. What is DevOps?

DevOps is the fusion of Development (writing code) and Operations (keeping the servers running). Historically, these were two separate teams that hated each other. Developers threw code over a wall, and Operations complained when the code crashed the servers. DevOps is the philosophy of tearing down that wall. It dictates that the same process used to write code should be used to test and deploy it automatically, ensuring both speed and stability.

5. The GitLab Ecosystem

GitHub is famous, but for many enterprises, GitLab is the superior choice because it is a "single application for the entire DevOps lifecycle." You don't need a separate tool for Git (like Bitbucket), a separate tool for CI/CD (like Jenkins), and a separate tool for security scanning (like SonarQube). GitLab does all of this natively within one single user interface.

6. Mini Project: Create GitLab Account and Repository

Before we can build pipelines, we need a place to put them.

Step-by-Step Walkthrough:

  1. 1. Navigate to gitlab.com in your web browser.
  1. 2. Click Register and create a free account.
  1. 3. Once logged in, click the New project/repository button.
  1. 4. Select Create blank project.
  1. 5. Name your project gitlab-ci-practice.
  1. 6. Set the visibility level to Private.
  1. 7. Ensure Initialize repository with a README is checked.
  1. 8. Click Create project.
  1. 9. *The Result:* You are now looking at your project dashboard. Notice the menu on the left side; this is where we will access the CI/CD features in upcoming chapters.

7. Continuous Integration vs Continuous Deployment

  • Continuous Integration (CI): The practice of merging all developers' working copies to a shared mainline several times a day. Every merge triggers an automated "Build and Test" sequence to catch integration bugs instantly.
  • Continuous Deployment (CD): The practice of automatically releasing that validated code directly to the production environment (the live website) without any human intervention.

8. Best Practices

  • Fail Fast: The goal of CI is not just to pass tests; it is to fail *as quickly as possible*. If a developer writes bad code, the CI pipeline should detect it and turn red within 2 minutes, not 2 hours. This immediate feedback loop is the psychological foundation of DevOps.

9. Common Mistakes

  • Confusing GitLab with Git: Just like GitHub, GitLab is a cloud hosting provider. Git is the underlying version control software running on your local laptop. You use Git commands (git commit, git push) to send your code to the GitLab servers.

10. Exercises

  1. 1. In the context of software engineering, what specific problem does Continuous Integration (CI) solve?
  1. 2. Why do many enterprise companies prefer GitLab's "single application" architecture over stitching together multiple different DevOps tools?

11. FAQs

Q: Does GitLab CI/CD cost money? A: GitLab offers a highly generous free tier for SaaS (hosted on gitlab.com) that includes hundreds of free CI/CD pipeline minutes per month. Furthermore, GitLab is open-source; you can install the entire GitLab platform on your own private server for free and have infinite pipeline minutes!

12. Summary

In Chapter 1, we introduced the paradigm-shifting concepts of CI/CD and DevOps. We learned that modern software delivery requires tearing down the walls between writing code and deploying it. We explored GitLab, recognizing it not merely as a cloud repository, but as a comprehensive, all-in-one automation platform. By successfully creating our GitLab account and initializing our first project, we have laid the groundwork to begin architecting automated robotic pipelines.

13. Next Chapter Recommendation

We have the factory, but we haven't built the conveyor belt yet. How do we actually tell GitLab to run our tests? Proceed to Chapter 2: Understanding GitLab Pipelines.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·