GitLab是一個(gè)基于 Web 的 Git?倉(cāng)庫(kù)管理工具,使用開源許可證银锻。
官網(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è)置密碼。搭建完成昼钻。