Gitlab build -centOS 7
Explanation
The company had previously built themselves, the record
Familiar with the relevant processes
A dead end, is to set up your own GitLab
There is an error, please point out -
download
Official website to download gitlab-ce-12.2.3
Web site to download gitlab-ce-12.2.3 Password: 3lnb
All versions of the official website
Ready to work
gitlab Installation Preparations
1. Install and configure the necessary dependencies (and the necessary pre-installation configuration)
On CentOS 7 (and RedHat/Oracle/Scientific Linux 7), the commands below will also open HTTP, HTTPS and SSH access in the system firewall.
In CentOS 7 (or other linux7), the following command to open the firewall HTTP, HTTPS and SSH access
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
Next, install Postfix to send notification emails. If you want to use another solution to send emails please skip this step and configure an external SMTP server after GitLab has been installed.
Next, install the mail notification service Postfix. If you want to use in other ways, you can skip, and configure other SMTP service installed and then GitLab
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
##### 2. Add the GitLab package repository (add GitLab package repository)
Add the GitLab package repository.
Add GitLab package repository
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
installation
Using the upload tool (Xftp, SecureFX, etc.) to download the installation package upload server GitLab
I am using scp direct upload
command:
scp gitlab-ce-12.2.3-ce.0.el7.x86_64.rpm [email protected]:/usr/local
Operation of personal circumstances
Into the installation package directory (I in / usr / local / directory), using the following command to install GitLab
cd /usr/local/
rpm -ivh ./gitlab-ce-12.2.3-ce.0.el7.x86_64.rpm
Url modify files in /etc/gitlab/gitlab.rbexternal_url
After modification, you need to use the command sudo gitlab-ctl reconfigure
to validate the configuration
- After installing GitLab, use the command
sudo gitlab-ctl reconfigure
to make the current configuration to take effect
Start the service and use
Use the command
gitlab start
to view the service to start[root@linux_gitlab gitlab]# gitlab-ctl start ok: run: alertmanager: (pid 51688) 34s ok: run: gitaly: (pid 51697) 32s ok: run: gitlab-monitor: (pid 51715) 32s ok: run: gitlab-workhorse: (pid 51721) 31s ok: run: grafana: (pid 51729) 31s ok: run: logrotate: (pid 51744) 30s ok: run: nginx: (pid 51752) 30s ok: run: node-exporter: (pid 51758) 31s ok: run: postgres-exporter: (pid 51762) 30s ok: run: postgresql: (pid 51783) 29s ok: run: prometheus: (pid 51873) 28s ok: run: redis: (pid 51880) 28s ok: run: redis-exporter: (pid 51886) 28s ok: run: sidekiq: (pid 51897) 24s ok: run: unicorn: (pid 51921) 19s
If the command
gitlab start
is invalidYou can run the command
sudo gitlab-ctl reconfigure
, and thengitlab start
tryBrowser to access: GitLab: http: //192.168.1.125, the new root password
Use the root account password GitLab
New projects
Select the blank item, enter the item name, the new can
Configuration
Just the new Git project, you will find the address clone project
http://gitlab.example.com/
does not need to re-configure the server to your own address
It only server IP (192.168.1.125), there is no domain name, so I will configure the domain part of the IP address changed
# 修改gitlab的配置文件, 路径: /etc/gitlab/gitlab.rb vim /etc/gitlab/gitlab.rb # 修改url为自己服务器的IP地址 external_url 'http://192.168.1.125' # 保存退出后, 使新配置生效 sudo gitlab-ctl reconfigure # 重启服务 gitlab-ctl restart
Log back GitLab, will find the address for the clone project
http://192.168.1.125/....
is correct
Test whether GitLab projects clone can be used normally
// 在macbook终端使用命令clone项目
VitodeMacBook-Pro:git_project vito$ git clone http://192.168.1.125/root/begin-gitlab.git
Cloning into 'begin-gitlab'...
Username for 'http://192.168.1.125': root
Password for 'http://[email protected]':
warning: You appear to have cloned an empty repository.