1. 程式人生 > >gitlab 10.4.4 Centos7 安裝

gitlab 10.4.4 Centos7 安裝

embedded auto fig star mirror start mir email nal

環境:
centos7.4
gitlab 10.4.4

設置防火墻:

sudo yum install curl openssh-server openssh-clients cronie
sudo lokkit -s http -s ssh

安裝

vim  /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1

yum makecache
yum install gitlab-ce

vim /etc/gitlab/gitlab.rb
# 修改變量
external_url ‘http://192.168.1.20‘

# 重新加載配置文件
gitlab-ctl reconfigure

漢化

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
10.4.4

git clone https://gitlab.com/xhang/gitlab.git
gitlab-ctl stop
cd gitlab/
git fetch
git diff v10.4.4 v10.4.4-zh > ../10.4.4-zh.diff
cd ..
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 <  10.4.4-zh.diff
gitlab-ctl start

郵箱


vim /etc/gitlab/girlab.rb

gitlab_rails[‘gitlab_email_from‘] = ‘[email protected]‘
gitlab_rails[‘smtp_enable‘] = true
gitlab_rails[‘smtp_address‘] = "smtp.163.com"
gitlab_rails[‘smtp_port‘] = 465
gitlab_rails[‘smtp_user_name‘] = "[email protected]"
gitlab_rails[‘smtp_password‘] = "password"
gitlab_rails[‘smtp_domain‘] = "smtp.163.com"
gitlab_rails[‘smtp_authentication‘] = "login"
gitlab_rails[‘smtp_enable_starttls_auto‘] = true
gitlab_rails[‘smtp_tls‘] = true
gitlab_rails[‘gitlab_email_from‘] = ‘[email protected]‘

#重新加載配置
gitlab-ctl reconfigure

#測試配置是否成功
gitlab-rails console

# 稍等幾分鐘
Notify.test_email(‘[email protected]‘, ‘測試主題‘, ‘測試內容‘).deliver_now

常用命令

gitlab-ctl status   查看GitLab的運行狀態
gitlab-ctl restart   重新啟動
gitlab-ctl tail unicorn  查看unicorn日誌; 按 Ctrl-C 退出
gitlab-ctl tail gitlab-rails 拉取/var/log/gitlab下子目錄的日誌
gitlab-ctl tail nginx/gitlab_error.log  拉取某個指定的日誌
gitlab-ctl tail 查看所有的logs; 按 Ctrl-C 退出

gitlab 10.4.4 Centos7 安裝