GitLab是一個(gè)基于 Web 的 Git?倉庫管理工具,使用開源許可證。
官網(wǎng):https://about.gitlab.com/
系統(tǒng)要求:
支持的發(fā)行版:Ubuntu,Debian,CentOS,openSUSE,Red Hat Enterprise Linux(請(qǐng)使用CentOS的包),Scientific Linux(請(qǐng)使用CentOS的包),Oracle Linux(請(qǐng)使用CentOS的包)。
ruby?2.3+
Redis
CentOS 7環(huán)境下的搭建:
官網(wǎng)安裝文檔:https://about.gitlab.com/installation
1.安裝并設(shè)置HTTP和SSH防火墻權(quán)限:
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 systemctl reload firewalld
2.安裝郵件服務(wù)器PostFix(可跳過,用SMTP服務(wù)器替代)
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
3.獲取安裝腳本,自行安裝所有依賴包
curl?https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
4.安裝GitLab
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ee
EXTERNAL_URL為GitLab打開頁面,最好設(shè)置成你的“服務(wù)器ip/gitlab”,如果此處不設(shè)置,后面需要修改ip地址
耐心等待,gitlab-ee包大約400+MB,安裝需要空間2G+.
其他配置問題:
修改Gitlab Ip地址:
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
vi /etc/gitlab/gitlab.rb
把配置文件中的external_url "http://gitlab.example.com"改為
external_url "http://服務(wù)器ip/gitlab"

其他更多配置都在這個(gè)文件里面,具體怎么配置見官網(wǎng)。
配置文件生效,這個(gè)過程需要一點(diǎn)時(shí)間:
sudo gitlab-ctl reconfigure
重啟GitLab:
sudo gitlab-ctl restart
重啟完成后在瀏覽器中輸入:
服務(wù)器ip/gitlab

即可進(jìn)入Gitlab首頁,第一次進(jìn)入會(huì)設(shè)置密碼。搭建完成。