如何在Centos8中安裝GitLab-CE

GitLab是一個基於web界面的Git倉庫管理程序,包括代碼審計、wikis、問題跟蹤等功能。使用GitLab創建、檢查和部署代碼非常容易。它可以託管在我們自己的服務器上,在官方服務器也提供免費的倉庫託管,類似於Github。

GitLab有三個不同的版本可用:Community Edition(CE)、Enterprise Edition(EE)和 GitLab託管版本。其中CE版本是開源免費的。EE版本是企業版,需要付費使用的。

環境

推薦cpu核心數量爲4核,推薦內存大小爲4GB。

安裝GitLab-CE

新建/etc/yum.repos.d/gitlab-ce.repo倉庫文件,然後複製內容到文件裏。

[root@localhost ~]# touch /etc/yum.repos.d/gitlab-ce.repo 

[gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1

如何在Centos8中安裝GitLab-CE如何在Centos8中安裝GitLab-CE
更新yum緩存,然後安裝gitlab-ce:

[root@localhost ~]# yum makecache
[root@localhost ~]# yum -y install gitlab-ce

如何在Centos8中安裝GitLab-CE如何在Centos8中安裝GitLab-CE
安裝完成。

防火牆中開放端口
[root@localhost ~]# firewall-cmd --permanent --add-service=http
success
[root@localhost ~]# firewall-cmd --permanent --add-service=https
success
[root@localhost ~]# firewall-cmd --reload
success
配置並啓動gitlab

剛安裝完,需要配置一下gitlab。

[root@localhost ~]# gitlab-ctl reconfigure

配置完成之後已經啓動所有服務了,已經設置好開機啓動了。

gitlab-ctl的常用的操作:

# 重置應用
gitlab-ctl reconfigure
# 啓動所有服務
gitlab-ctl start
# 關閉所有服務
gitlab-ctl stop
# 重啓所有服務
gitlab-ctl restart
# 列出所有服務
gitlab-ctl service-list
# 查看服務狀態
gitlab-ctl status
web界面訪問GitLab

在瀏覽器輸入本機ip地址,訪問gitlab,第一次訪問需要爲管理員設置密碼:
如何在Centos8中安裝GitLab-CE如何在Centos8中安裝GitLab-CE
默認的用戶是root,剛設置好密碼,可以登錄了:
如何在Centos8中安裝GitLab-CE如何在Centos8中安裝GitLab-CE

如何在Centos8中安裝GitLab-CE如何在Centos8中安裝GitLab-CE
然後就可以創建project了。
如何在Centos8中安裝GitLab-CE如何在Centos8中安裝GitLab-CE

總結

GitLab能夠集成大量的工具,如Slack、Hipchat、LDAP、JIRA、Jenkins、許多類型的鉤子和一個完整的API。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章