1.安装相关依赖包
[root@LC02 app]# yum -y install curl openssh-server openssh-clients cronie #postfix也可以安装也可以不安装。
Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): updates/7/x86_64/primary_db | 1.0 MB 00:00:00
(2/4): extras/7/x86_64/primary_db | 125 kB 00:00:02
(3/4): base/7/x86_64/group_gz | 166 kB 00:00:03
(4/4): base/7/x86_64/primary_db | 5.9 MB 00:00:06
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.cn99.com
* updates: mirrors.aliyun.com
.........................
Updated:
cronie.x86_64 0:1.4.11-19.el7 curl.x86_64 0:7.29.0-46.el7
openssh-clients.x86_64 0:7.4p1-16.el7 openssh-server.x86_64 0:7.4p1-16.el7
Dependency Updated:
cronie-anacron.x86_64 0:1.4.11-19.el7 libcurl.x86_64 0:7.29.0-46.el7
libcurl-devel.x86_64 0:7.29.0-46.el7 openssh.x86_64 0:7.4p1-16.el7
Complete!
2.上传gitlab包到/app下
[root@LC02 ~]# cd /app
[root@LC02 app]# rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring gitlab-ee-10.7.3-ee.0.el7.x86_64.rpm...
100% 453115 KB 4671 KB/sec 00:01:37 0 Errors
Transferring qiai365-gitlab-L-zh-8-6-zh.zip...
100% 16944 KB 8472 KB/sec 00:00:02 0 Errors
3.安装gitlab
[root@LC02 app]# rpm -ivh gitlab-ee-10.7.3-ee.0.el7.x86_64.rpm
warning: gitlab-ee-10.7.3-ee.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:gitlab-ee-10.7.3-ee.0.el7 ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
4.启动gitlab
[root@LC02 app]# gitlab-ctl reconfigure #任何更改都需要reconfigure
..............................
每次重新配置,都需要执行gitlab-ctl reconfigure 使之生效。
5.修改gitlab存储位置
[root@LC02 app]#vi /etc/gitlab/gitlab.rb
git_data_dirs({
"default" => {
"path" => "/app/gitlab",
"failure_count_threshold" =>10,
"failure_wait_time" =>30,
"failure_reset_time" =>1800,
"storage_timeout" =>30
}
})
6.汉化
[root@LC02 app]# git clone https://git.oschina.net/qiai365/gitlab-L-zh.git
Cloning into 'gitlab-L-zh'...
remote: Counting objects: 261896, done.
remote: Compressing objects: 100% (60883/60883), done.
remote: Total 261896 (delta 204174), reused 255084 (delta 197563)
Receiving objects: 100% (261896/261896), 121.54 MiB | 837.00 KiB/s, done.
Resolving deltas: 100% (204174/204174), done.
Checking out files: 100% (3483/3483), done.
[root@LC02 app]# cd gitlab-L-zh
汉化之前先停止gitlab
[root@LC02 gitlab-L-zh]# git checkout -b 8-5-zh origin/8-5-zh
Branch '8-5-zh' set up to track remote branch '8-5-zh' from 'origin'.
Switched to a new branch '8-5-zh'
[root@LC02 gitlab-L-zh]# cp -r /opt/gitlab/embedded/service/gitlab-rails{,.ori}
[root@LC02 gitlab-L-zh]# gitlab-ctl stop
ok: down: gitaly: 1s, normally up
ok: down: gitlab-monitor: 1s, normally up
ok: down: gitlab-workhorse: 0s, normally up
ok: down: logrotate: 1s, normally up
ok: down: nginx: 0s, normally up
ok: down: node-exporter: 0s, normally up
ok: down: postgres-exporter: 0s, normally up
ok: down: postgresql: 0s, normally up
ok: down: prometheus: 0s, normally up
ok: down: redis: 0s, normally up
ok: down: redis-exporter: 0s, normally up
ok: down: sidekiq: 1s, normally up
ok: down: unicorn: 0s, normally up
开始汉化操作
[root@LC02 gitlab-L-zh]# yes|cp -rf ../gitlab-L-zh/* /opt/gitlab/embedded/service/gitlab-rails/
[root@LC02 gitlab-L-zh]# gitlab-ctl reconfigure
[root@LC02 gitlab-L-zh]# gitlab-ctl start #启动gitlab,启动之前先执行gitlab-ctl reconfigure