新建 /etc/yum.repos.d/gitlab-ce.repo
,內容爲nginx
[gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6 repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=https://packages.gitlab.com/gpg.key
再執行git
sudo yum makecache sudo yum install gitlab-ce
gitlab-ctl status
run: gitlab-workhorse: (pid 3133) 5619s; run: log: (pid 3000) 5687s run: logrotate: (pid 7021) 2078s; run: log: (pid 3023) 5679s run: nginx: (pid 3008) 5685s; run: log: (pid 3007) 5685s run: postgresql: (pid 2861) 5735s; run: log: (pid 2860) 5735s run: redis: (pid 2778) 5741s; run: log: (pid 2777) 5741s run: sidekiq: (pid 2991) 5688s; run: log: (pid 2990) 5688s run: unicorn: (pid 2960) 5694s; run: log: (pid 2959) 5694s |
# Start all GitLab components sudo gitlab-ctl start # Stop all GitLab components sudo gitlab-ctl stop # Restart all GitLab components sudo gitlab-ctl restart
vi /etc/gitlab/gitlab.rbredis
gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.exmail.qq.com" gitlab_rails['smtp_port'] = 465 gitlab_rails['smtp_user_name'] = "xxxx@xx.com" gitlab_rails['smtp_password'] = "password" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_tls'] = true gitlab_rails['gitlab_email_from'] = 'xxxx@xx.com'
修改 external_url
,編輯 /etc/gitlab/gitlab.rb
:sql
external_url "git.home.com"
修改 /etc/hosts ,添加服務器
127.0.0.1 git.home.comapp
Reconfigure GitLab 使上面的修改生效:ide
sudo gitlab-ctl reconfigure
重啓下GitLab:gitlab
sudo gitlab-ctl restart
在本地修改 git.home.com 只想gitlab-ce服務器的地址便可.post
首先確認當前安裝版本url
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
當前安裝版本是8.5.7
,所以中文補丁須要打8.5版本
。
克隆 GitLab 源碼倉庫:
# 克隆 GitLab.com 倉庫 git clone https://gitlab.com/larryli/gitlab.git #或 Gitcafe.com 鏡像,速度更快 git clone https://gitcafe.com/larryli/gitlab.git
運行漢化補丁:
# 8.5 版本的漢化補丁(8-5-stable是英文穩定版,8-5-zh是中文版,兩個 diff 結果即是漢化補丁) sudo git diff origin/8-5-stable..8-5-zh > /tmp/8.5.diff # 中止 gitlab sudo gitlab-ctl stop # 應用漢化補丁 cd /opt/gitlab/embedded/service/gitlab-rails git apply /tmp/8.5.diff # 啓動gitlab sudo gitlab-ctl start
至此,漢化完畢。打開地址http://git.home.com
,便會看到中文版的GitLab
。
內置的也能夠使用.若是要使用外置用一下配置