GitLab:GitLab服務的搭建
來源:程序員人生 發(fā)布時間:2016-09-06 15:26:10 閱讀次數(shù):2812次
現(xiàn)在就迫不及待的來開始我們自己的GitLab服務器的搭建吧。由于我們是個人用戶的探索,所有我們選擇免費的GitLab Community Edition進行演示;
1.首先,我們應當明確GitLab只支持Unix的發(fā)布版(故,我在Mac虛擬機中安裝Ubuntn):
2.其次,對硬件的要求如CPU(建議雙核)、內存(建議2G)、存儲、數(shù)據(jù)庫和閱讀器等,由于目前的電腦配置基本都滿足,并且我們只是進行搭建服務器的演示操作,所以沒必要要過量的糾結;如果在實際的開發(fā)的場景中,請參考官方文檔:https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/requirements.md;
安裝進程中,提示配置General type of mail configuration選擇Internet Site,提示配置System mail name輸入xxx.com便可:
pengchengxiang@ubuntu:~$ sudo apt-get install curl openssh-server ca-certificates postfix
[sudo] password for pengchengxiang:
Reading package lists... Done
… …
/etc/aliases does not exist, creating it.
WARNING: /etc/aliases exists, but does not have a root alias.
Postfix is now set up with a default configuration. If you need to make
changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).
After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.
Running newaliases
Setting up ssh-import-id (5.5-0ubuntu1) ...
Processing triggers for ureadahead (0.100.0⑴9) ...
Processing triggers for systemd (229⑷ubuntu4) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
4.添加gitlab包服務,并安裝包 pengchengxiang@ubuntu:~$ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
[sudo] password for pengchengxiang:
Detected operating system as Ubuntu/xenial.
… …
Importing packagecloud gpg key... done.
Running apt-get update... done.
The repository is setup! You can now install packages.
pengchengxiang@ubuntu:~$ sudo apt-get install gitlab-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
… …
gitlab:
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab:
It looks like GitLab has not been configured yet; skipping the upgrade script.
5.配置和啟動GitLab pengchengxiang@ubuntu:~$ sudo apt-get install gitlab-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers⑷.4.0⑵1 linux-headers⑷.4.0⑵1-generic
linux-image⑷.4.0⑵1-generic linux-image-extra⑷.4.0⑵1-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
gitlab-ce
0 upgraded, 1 newly installed, 0 to remove and 208 not upgraded.
Need to get 281 MB of archives.
After this operation, 778 MB of additional disk space will be used.
... ...
Running handlers:
Running handlers complete
Chef Client finished, 225/313 resources updated in 02 minutes 59 seconds
gitlab Reconfigured!
6.閱讀主機和登錄 接下來我們在閱讀器中輸入localhost,就能夠訪問GitLab服務了,以下圖:
第1次訪問的時候,你將會跳轉到密碼重置頁面來初始化管理員賬戶密碼。輸入你的密碼后你將會被跳轉到登錄頁面,默許的賬戶名稱root。登錄完成以后,你可以根據(jù)你的意愿修改用戶名。
生活不易,碼農辛苦
如果您覺得本網(wǎng)站對您的學習有所幫助,可以手機掃描二維碼進行捐贈