[GitLab] 在CentOS安裝 GitLab

GitLab 是一套開源的版本控制軟件 (Version Control), 在官方中它亦只介紹安裝Enterprise Edition, 雖然功能齊備, 但魔鬼在細節中, 過了試用期後問題便會陸續出現. 所以若須要在production 使用, 不不用太多整合的話, community edition 其實已經夠用. 在示範中會透過yum 去安裝GitLab community edition.

  1. 安裝SSHD 及設定Firewall.
    利用root 權限, 在bash 輸入以下指令:

    sudo yum install -y curl policycoreutils-python openssh-server openssh-clients
    sudo systemctl enable sshd
    sudo systemctl start sshd
    sudo firewall-cmd --permanent --add-service=http
    sudo systemctl reload firewalld
    
  2. 建立Mail server 去發送通知.
    利用root 權限, 在bash 輸入以下指令:

    yum install postfix
    systemctl enable postfix
    systemctl start postfix
  3. 加入GitLab repository.
    利用root 權限, 在bash 輸入以下指令:

    curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash

    若要安裝Enterprise Edition 的話, 則輸入以下指令:

    curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | bash
  4. 安裝GitLab.
    利用root 權限, 在bash 輸入以下指令, 示範的URL 為http://POC-GITLAB.local:

    EXTERNAL_URL="http://POC-GITLAB.local" yum install -y gitlab-ce
    

    若要安裝Enterprise Edition 的話, 則輸入以下指令:

    EXTERNAL_URL="http://POC-GITLAB.local" yum install -y gitlab-ee
  5. 登入測試.
    於瀏覽器輸入http://localhost, 利用root 進行登入.
  6. 登入後見到以下畫面, 代表測試成功.

參考資料

About C.H. Ling 262 Articles
a .net / Java developer from Hong Kong and currently located in United Kingdom. Thanks for Google because it solve many technical problems so I build this blog as return. Besides coding and trying advance technology, hiking and traveling is other favorite to me, so I will write down something what I see and what I feel during it. Happy reading!!!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.