???? GitLab是一個利用 Ruby on Rails 開發(fā)的開源應用程序,實現(xiàn)一個自托管的Git項目倉庫,可通過Web界面進行訪問公開的或者私人項目。
??????? GitLab擁有與Github類似的功能,能夠瀏覽源代碼,管理缺陷和注釋。可以管理團隊對倉庫的訪問,它非常易于瀏覽提交過的版本并提供一個文件歷史庫。它還提供一個代碼片段收集功能可以輕松實現(xiàn)代碼復用,便于日后有需要的時候進行查找。
?????? 1.基礎環(huán)境準備
[root@linux-node2 ~]# yum install curl policycoreutils openssh-server openssh-clients postfix[root@linux-node2 ~]# systemctl start postfix
??? 2.安裝gitlab-ce
curl -sShttps://packages.gitlab.com/in ... pm.sh| sudo bash[root@linux-node2 ~]# yum install -y gitlab-ce
注:由于網(wǎng)絡問題,國內用戶,建議使用清華大學的鏡像源進行安裝:
[root@linux-node2 ~]# vim /etc/yum.repos.d/gitlab-ce.repo[gitlab-ce]name=gitlab-cebaseurl=http://mirrors.tuna.tsinghua.e ... m/el7repo_gpgcheck=0gpgcheck=0enabled=1gpgkey=https://packages.gitlab.com/gpg.key[root@linux-node2 ~]# yum makecache[root@linux-node2 ~]# yum install gitlab-ce
3.配置并啟動gitlab-ce
[root@linux-node2 ~]# gitlab-ctl reconfigure
可以使用gitlab-ctl管理gitlab,例如查看gitlab狀態(tài):
[root@linux-node2 ~]# gitlab-ctl statusrun: gitlab-workhorse: (pid 12171) 231s; run: log: (pid 7817) 555srun: logrotate: (pid 12175) 230s; run: log: (pid 7832) 548srun: nginx: (pid 12181) 230s; run: log: (pid 7823) 549srun: postgresql: (pid 12186) 229s; run: log: (pid 7683) 587srun: redis: (pid 12194) 229s; run: log: (pid 7600) 592srun: sidekiq: (pid 12198) 229s; run: log: (pid 7806) 558srun: unicorn: (pid 14967) 6s; run: log: (pid 7774) 560s關閉gitlab:[root@linux-node2 ~]# gitlab-ctl stop啟動gitlab:[root@linux-node2 ~]# gitlab-ctl start重啟gitlab:[root@linux-node2 ~]# gitlab-ctl restart
登錄gitlab
????? 第一次登錄gitlab,需要為root用戶修改密碼,root用戶也是gitlab的超級管理員。
管理gitlab
??? 使用root用戶和剛才創(chuàng)建的密碼登錄后,你就可以探索gitlab的奧秘了,可以點擊圖中紅框的按鈕進入管理區(qū)域。