Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Setting Up GitLab and Jenkins for CI/CD Integration

Tech 1

Installing GitLab

Obtaining GitLab Package

Download the appropriate GitLab CE package from the Tsinghua University Open Source Mirror site:

Index of /gitlab-ce/yum/el7/

Instaling Prerequisites

Install required system dependencies:

yum install -y curl policycoreutils-python openssh-server

Enable and start SSH service if not already running:

systemctl enable sshd
systemctl start sshd

For email notification support, install Postfix:

yum install postfix
systemctl enable postfix
systemctl start postfix

GitLab Installation Process

Install the downloaded RPM package:

rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

Configuration Steps

Edit the main configuration file:

vi /etc/gitlab/gitlab.rb

Set the external URL:

external_url 'http://server-ip:port'

To resolve potential 502 errors due to port conflicts, modify Unicorn port:

unicorn['port'] = 8101

Apply configuration changes:

gitlab-ctl reconfigure

Service management commands:

gitlab-ctl start
gitlab-ctl stop
gitlab-ctl restart

Retrieve initial root password:

cat /etc/gitlab/initial_root_password

Jenkins Setup

Prerequisites: Java JDK, Maven, and Git should be installed.

Download Jenkins WAR file from the official site and start:

nohup java -jar jenkins.war --httpPort=8080 &

SSH Key Configuration

Install SSH utilities:

yum install ssh-copy-id

Generate SSH keys:

ssh-keygen

Distirbute public key to target servers:

ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.1.194
ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.1.196

Test passwordless SSH connection:

ssh root@192.168.1.194

Related Articles

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

SBUS Signal Analysis and Communication Implementation Using STM32 with Fus Remote Controller

Overview In a recent project, I utilized the SBUS protocol with the Fus remote controller to control a vehicle's basic operations, including movement, lights, and mode switching. This article is aimed...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.