centos/debian配置gitlab 7.1x來搭建自建的git倉庫.

來源:互聯網
上載者:User

標籤:gitlab   配置   庫   centos   debian   

centos/debian配置gitlab 7.1x來搭建自建的git倉庫. 前言:因為公司的某些曆史原因, 有大量的代碼還在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.runResolving downloads.bitnami.com... 216.235.167.23Connecting to downloads.bitnami.com|216.235.167.23|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 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][[email protected]]# chmod a+x bitnami-gitlab-7.11.4-0-linux-x64-installer.run [[email protected]]# ./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]: yThe 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] :YIs the selection above correct? [Y/n]: Y----------------------------------------------------------------------------Installation folderPlease, choose a folder to install Bitnami Gitlab StackSelect a folder [/opt/gitlab-7.11.4-0]: /opt/bitnami----------------------------------------------------------------------------Create Admin accountBitnami Gitlab Stack admin user creationEmail Address [[email protected]]: [email protected]Login [user]:  rainysiaPassword :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.orgDo 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 tohttp://dev.domain.org:80 from your browser.Press [Enter] to continue:

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

使用很簡單了

有幾個使用的說明,

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

centos/debian配置gitlab 7.1x來搭建自建的git倉庫.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.