歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS/Debian配置Gitlab 7.1x來搭建自建的Git倉庫

CentOS/Debian配置Gitlab 7.1x來搭建自建的Git倉庫

日期:2017/2/28 14:00:55   编辑:Linux教程

前言:因為公司的某些歷史原因, 有大量的代碼還在csv/svn上. 新來的項目不得不走這個,同時,github的enterprise 2500$/y/10p的價格對於多變的項目和人員也不合適. 也為了讓某些不習慣使用linux的開發使用上git, 就放棄了之前的gitolite server, 進而采用gitlab來搭建.

--------------------------------------------------------------------------------

www.gitlab.com 是gitlab的倉庫, 以前的歷史版本, 需要先配置gitolite, 然後配server端來支持web功能. 新的已經實現一鍵包了.

-下載

使用https://about.gitlab.com/downloads/ 來選擇對應的版本
wget 後直接運行一鍵腳本就可以了.

這個官方的版本非常不友好, 一鍵裝完, 什麼都沒配置. 配了半天, 發現repo的地址還是domain.com…

gitlab也支持分開安裝, 你自己指定server, 數據庫這些, 如果一個一個裝, 7個流程走下來, 也太過繁瑣. 所以我們換一個公司出的,bitnami出的一鍵包.

地址在https://bitnami.com/stack/gitlab/installer

可以根據系統來選擇是32還是64bit的, 推薦用recommended的版本.

下載到服務器後, 先去檢查下服務器的80端口是否給占用. 停掉nginx or apache/httpd
把它們轉到808x. 我這裡要用一個完整的域名來使用gitlab,
e.g:http://dev.domain.org

安裝前, 刪除掉已經有的git帳號, 和git的home目錄. 保證系統干淨.


[[email protected]]# wget https://downloads.bitnami.com/files/stacks/gitlab/7.11.4-0/bitnami-gitlab-7.11.4-0-linux-x64-installer.run
--2015-06-09 19:31:19-- https://downloads.bitnami.com/files/stacks/gitlab/7.11.4-0/bitnami-gitlab-7.11.4-0-linux-x64-installer.run
Resolving downloads.bitnami.com... 216.235.167.23
Connecting to downloads.bitnami.com|216.235.167.23|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 311542012 (297M) [application/x-makeself]
Saving to: “bitnami-gitlab-7.11.4-0-linux-x64-installer.run”

100%[===========================================================================================================================================================>] 311,542,012 2.06M/s in 2m 40s

2015-06-09 19:34:05 (1.86 MB/s) - “bitnami-gitlab-7.11.4-0-linux-x64-installer.run” saved [311542012/311542012]

[root@fca-vm-demo-opt]# chmod a+x bitnami-gitlab-7.11.4-0-linux-x64-installer.run

[root@fca-vm-demo-opt]# ./bitnami-gitlab-7.11.4-0-linux-x64-installer.run
The installer detects that exists a 'git' user in the system. This installer will change the configuration for this user. Do you want to continue the installation? [y/N]: y

The installer detects that exists a 'gitlab_ci' user in the system. This installer will change the configuration for this user. Do you want to continue the installation? [y/N]: y

----------------------------------------------------------------------------
Welcome to the Bitnami Gitlab Stack Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.

PhpPgAdmin [Y/n] :Y

GitLab : Y (Cannot be edited)

GitLab CI [Y/n] :Y

Is the selection above correct? [Y/n]: Y

----------------------------------------------------------------------------
Installation folder

Please, choose a folder to install Bitnami Gitlab Stack

Select a folder [/opt/gitlab-7.11.4-0]: /opt/bitnami

----------------------------------------------------------------------------
Create Admin account

Bitnami Gitlab Stack admin user creation

Email Address [[email protected]]: [email protected]

Login [user]: rainysia

Password :
Please confirm your password :

----------------------------------------------------------------------------
Hostname that will be used to create internal URLs. If this value is incorrect,
you may be unable to access your Gitlab installation from other computers. It is
advisable to use a Domain instead of an IP address for compatibility with
different browsers.

Domain [127.0.0.1]: dev.domain.org
Do you want to configure mail support? [y/N]: N

----------------------------------------------------------------------------
Setup is now ready to begin installing Bitnami Gitlab Stack on your computer.

Do you want to continue? [Y/n]: Y

----------------------------------------------------------------------------
Please wait while Setup installs Bitnami Gitlab Stack on your computer.

Installing
0% ______________ 50% ______________ 100%
#########################################

----------------------------------------------------------------------------
Setup has finished installing Bitnami Gitlab Stack on your computer.

Info: To access the Bitnami Gitlab Stack, go to
http://dev.domain.org:80 from your browser.
Press [Enter] to continue:


這樣就裝好了. 中間容易出問題的地方, git本來的帳號, 各個gitlab和git的home目錄, 以及/var/opt下的gitlab目錄, 我這裡沒有設置mail server

使用很簡單了
有幾個使用的說明,

gitlab不支持initial repo, 所以你需要先用一個https://的git倉庫來導入.
配置ssh key後, 是在 /profile這裡面的/profile/key e.g:http://dev.domain.org/profile/keys
保證你要使用倉庫的用戶的ssh key是id_ras.pub key
拉取的時候直接用 [email protected]:username/project_name.git ,如果是read, 可以走http.
因為這裡為沒有走其它端口或者2級,3級域名, 所以需要走其他端口的, 需要在域名那裡重配. 整個gitlab都在/opt/下, 裡面的apps是應用,ctlscript.sh是配置重置重啟shell

在 Ubuntu 12.04 上安裝 GitLab http://www.linuxidc.com/Linux/2012-12/75249.htm

GitLab 5.3 升級注意事項 http://www.linuxidc.com/Linux/2013-06/86473.htm

在 CentOS 上部署 GitLab (自托管的Git項目倉庫) http://www.linuxidc.com/Linux/2013-06/85754.htm

在RHEL6/CentOS6/ScientificLinux6上安裝GitLab 6.0.2 http://www.linuxidc.com/Linux/2014-03/97831.htm

CentOS 6.5安裝GitLab教程及相關問題解決 http://www.linuxidc.com/Linux/2014-05/101526.htm

GitLab 的詳細介紹:請點這裡
GitLab 的下載地址:請點這裡

Copyright © Linux教程網 All Rights Reserved