Operations 11 min read

AI Code Review Tutorial Part 5: Installing Enterprise‑Grade GitLab and Configuring CI

This guide walks through installing GitLab CE 17.1.3 on a CentOS 7 server, configuring the service, setting up a GitLab Runner, registering it with a project, and preparing the environment for automated AI‑assisted code reviews via CI pipelines.

Ubiquitous Tech
Ubiquitous Tech
Ubiquitous Tech
AI Code Review Tutorial Part 5: Installing Enterprise‑Grade GitLab and Configuring CI

In an enterprise setting, developers can trigger AI‑powered code reviews automatically after each commit. To enable this workflow, the article demonstrates how to set up a self‑hosted GitLab instance and a GitLab Runner on a CentOS 7 machine.

GitLab Installation

The author chooses GitLab CE 17.1.3, the last version supporting CentOS 7. The installation package is downloaded from the official GitLab package repository:

https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=17.1&filter=all&dist=

After uploading the RPM to /opt on the server, required dependencies are installed:

yum install -y curl policycoreutils-python openssh-server perl postfix

Postfix is enabled and started:

systemctl enable postfix
systemctl start postfix

The GitLab RPM is then installed: rpm -ivh gitlab-ce-17.1.3-ce.0.el7.x86_64.rpm The configuration file /etc/gitlab/gitlab.rb is edited to set the external URL, e.g.: external_url 'http://1.1.1.1:9321' Port 9321 is opened in the firewall (optional):

firewall-cmd --zone=public --add-port=9321/tcp --permanent
systemctl reload firewalld

GitLab is reconfigured and started:

sudo gitlab-ctl reconfigure
gitlab-ctl start

The initial root password is retrieved from /etc/gitlab/initial_root_password and used to log in via the web UI. After logging in, the default password is changed, language set to Chinese, and a new user is created through the admin interface.

GitLab Runner Installation

GitLab Runner, an open‑source CI/CD executor, is installed by first adding the repository script:

curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh" | sudo bash

Then the Runner package is installed: sudo yum install gitlab-runner-17.1.1-1 After installation, a project‑level Runner is registered. The UI provides a registration command similar to:

gitlab-runner register --url http://1.1.1.1:1118 --token xxxxxx

During registration, the shell executor is selected. The Runner is started with:

gitlab-runner run

Creating a Test Project and CI Pipeline

A new project is created in GitLab, a user is added, and an SSH key is configured. The project is cloned locally, and a simple .gitlab-ci.yml containing a HelloWorld job is added:

stages:
  - test

hello_world:
  stage: test
  script:
    - echo "Hello World"

After pushing the commit, the pipeline is triggered on the Runner. The pipeline execution log shows the job running successfully, confirming that the CI/CD environment is operational.

Conclusion

By following these steps—installing GitLab CE, configuring the external URL and firewall, setting up a GitLab Runner with a shell executor, and creating a test CI pipeline—the article establishes a functional, enterprise‑grade platform ready for AI‑assisted code review automation.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AutomationLinuxCentOSGitLab Runner
Ubiquitous Tech
Written by

Ubiquitous Tech

A ubiquitous public account for pirate enthusiasts, regularly sharing curated experiences, tech learning, and growth insights. Currently publishing articles on AI RAG customer service, AI MCP technology, and open-source design. Personal free Knowledge Planet: Awakening New World Programmer.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.