1. 程式人生 > >DevOps實踐之Gitlab安裝部署

DevOps實踐之Gitlab安裝部署

dha 定義 設置 oca color chkconfig smt 接下來 .sh

All GitLab packages are posted to our package server and can be downloaded. We maintain five repos:

  • GitLab EE: for official Enterprise Edition releases
  • GitLab CE: for official Community Edition releases
  • Unstable: for release candidates and other unstable versions
  • Nighty Builds: for nightly builds
  • Raspberry Pi 2: for Raspberry Pi 2 packages

Tips 1:

On CentOS 6 (and RedHat/Oracle/Scientific Linux 6) -- use el6

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-696.el6.x86_64 #1 SMP Tue Feb 21 00:53:17 EST 2017 x86_64 x86_64 x86_64 GNU/Linux

On CentOS 7 (and RedHat/Oracle/Scientific Linux 7) -- use el7

Linux 121.100.com 3.10.0-327.el7.x86_64…..

Tips 2:

一定在x64 linux 系統下安裝,避免出現未知問題

快速安裝部署

//安裝並配置必要的依賴關系
sudo yum install curl openssh-server postfix cronie policycoreutils-python

//配置系統防火墻,開放HTTP和SSH端口
sudo lokkit -s http -s ssh
//接下來,安裝Postfix發送通知郵件。如果您想使用其他解決方案發送電子郵件,請跳過此步驟並在安裝GitLab後配置外部SMTP服務器。
sudo yum install postfix
sudo service postfix start
sudo chkconfig postfix on

//下載rpm安裝包 sudo curl -O http://mirrors.zju.edu.cn/gitlab-ce/yum/el6/gitlab-ce-10.6.0-ce.0.el6.x86_64.rpm sudo rpm -ivh gitlab-ce-10.6.0-ce.0.el6.x86_64.rpm //這一步也可以用管道的方式安裝: //curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash //sudo yum install gitlab-ee //修改 自帶的nginx配置服務端口 vi /var/opt/gitlab/nginx/conf/gitlab-http.conf #端口自定義 listen *:9090; //郵件服務器配置,外部訪問地址設置 vi /etc/gitlab/gitlab.rb #修改內容external_url ‘http://192.168.5.112‘ //保存配置 sudo gitlab-ctl reconfigure //啟動運行,以及查看狀態 sudo gitlab-ctl start //stop sudo gitlab-ctl status

 

瀏覽器打開http://192.168.5.112:9090

第一次登錄會要求設置root的密碼,設置完成即完成部署

技術分享圖片

DevOps實踐之Gitlab安裝部署