CentOS 7 部署GitLab 12.3.5 並漢化

# 使用國內清華鏡像安裝
[root@192 src]# vi /etc/yum.repos.d/gitlab-ce.repo
[root@192 src]# sudo yum install curl policycoreutils-python openssh-server openssh-clients
[root@192 src]# sudo systemctl enable sshd
[root@192 src]# sudo yum install postfix
[root@192 src]# curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm
[root@192 src]# ls
apache-tomcat-9.0.27.tar.gz              jdk-8u231-linux-x64.tar.gz
azuredatastudio-linux-1.13.0.tar.gz      lnmp1.6
git-2.24.0.tar.xz                        lnmp1.6.tar.gz
gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm     WebStorm-193.5096.13.tar.gz
google-chrome-stable_current_x86_64.rpm
[root@192 src]# rpm -ivh gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm

# 安裝成功

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

[root@192 src]# 

2. 漢化Gitlab 12.3.5

[root@192 src]# git clone https://gitlab.com/xhang/gitlab.git -b v12.3.5-zh
Cloning into 'gitlab'...
remote: Enumerating objects: 1059432, done.
remote: Counting objects: 100% (1059432/1059432), done.
remote: Compressing objects: 100% (218635/218635), done.
remote: Total 1059432 (delta 829843), reused 1056791 (delta 827205)
Receiving objects: 100% (1059432/1059432), 452.84 MiB | 2.44 MiB/s, done.
Resolving deltas: 100% (829843/829843), done.
Note: switching to '0671aeaf94525f5d6a6a48ed4523b93454acfa7b'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (17493/17493), done.
[root@192 src]# ls
apache-tomcat-9.0.27.tar.gz          git-2.24.0.tar.xz  gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm     jdk-8u231-linux-x64.tar.gz  lnmp1.6.tar.gz
azuredatastudio-linux-1.13.0.tar.gz  gitlab             google-chrome-stable_current_x86_64.rpm  lnmp1.6                     WebStorm-193.5096.13.tar.gz
[root@192 src]# cd gitlab
[root@192 gitlab]# git diff v12.3.5 v12.3.5-zh > ../12.3.5-zh.diff
[root@192 gitlab]# cd ../
[root@192 src]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 12.3.5-zh.diff

3. 配置GitLab端口

[root@192 src]# vim /etc/gitlab/gitlab.rb

# 修改以下內容
external_url 'http://192.168.0.105:15038'

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章