CentOS 7 部署GitLab 13.7.1 并汉化

 20201225更新

  1.   关于GitLab版本下载说明[非常重要]:GitLab的el版本号一定要与当前CentOS的系统版本号一致
    [root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm
    # 这里的el7代表的是CentOS7版本的GitLab-v13.7.1,
    # 因为有看到很多帖子显示依赖明明装上了但是rpm安装的时候依然报错policycoreutils-python-utils is needed by gitlab-ce,
    # 问题就在包的CentOS版本上,下载的GitLab的el版本号一定要与当前CentOS7系统版本号一致

     

  2. 发现 https://gitlab.com/xhang/gitlab.git(https://gitee.com/panda26/gitlab.git) 汉化包已不再提供支持,故使用的是GitLab自带的语言设置,虽然汉化不全面但不影响日常使用;


GitLab 13.7.1 安装与配置

# 依赖安装与配置
[root@localhost ~]# sudo yum install wget vim policycoreutils-python policycoreutils-python-utils openssh-server openssh-clients postfix
# 开启邮件服务
[root@localhost src]# systemctl enable postfix
[root@localhost src]# systemctl start postfix

# GitLab 13.7.1 下载
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm
[root@localhost src]# ls -ll
total 808456
-rw-r--r--. 1 root root 827858918 Dec 23 14:10 gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm


# GitLab 13.7.1 安装与配置
# 安装 GitLab 13.7.1
[root@localhost src]# rpm -ivh gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm 
warning: gitlab-ce-13.7.1-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:gitlab-ce-13.7.1-ce.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

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=13-7

# 重新配置GitLab
[root@localhost src]# gitlab-ctl reconfigure
# 重新启动GitLab
[root@localhost src]# gitlab-ctl restart

# 关闭并禁用防火墙
[root@localhost src]# systemctl stop firewalld
[root@localhost src]# systemctl disable firewalld

# 浏览器访问虚拟机中的 http://192.168.186.129/

 

 


GitLab 13.7.1 汉化

 

 

 


GitLab 13.7.1 修改默认端口号

# 发现 80端口被 GitLab 13.7.1 占用了
[root@localhost local]# netstat -tunpl | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      5596/nginx: master  
tcp        0      0 0.0.0.0:8060            0.0.0.0:*               LISTEN      5596/nginx: master


# 停止GitLab并配置端口
[root@localhost src]# gitlab-ctl stop
[root@localhost src]# vim /etc/gitlab/gitlab.rb
# :32 跳转到32行 注释掉原配置后 修改 暴露的IP和端口
# external_url 'http://gitlab.example.com'
external_url 'http://192.168.186.129:15080'  


# 重新配置GitLab
[root@localhost src]# gitlab-ctl reconfigure
# 重新启动GitLab
[root@localhost src]# gitlab-ctl restart

# 再次查询端口占用 发现 端口已变更为 15080
[root@localhost local]# netstat -tunpl | grep 80
tcp        0      0 0.0.0.0:8060            0.0.0.0:*               LISTEN      7074/nginx: master  
tcp        0      0 0.0.0.0:15080           0.0.0.0:*               LISTEN      7074/nginx: master  
# 再去浏览器中再次确认
http://192.168.186.129:15080/admin

 


GitLab 13.7.1 常用命令

gitlab-ctl start    # 启动所有 gitlab 组件
gitlab-ctl stop        # 停止所有 gitlab 组件
gitlab-ctl restart        # 重启所有 gitlab 组件
gitlab-ctl status        # 查看服务状态
gitlab-ctl reconfigure        # 启动服务
vim /etc/gitlab/gitlab.rb        # 修改默认的配置文件
gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab
sudo gitlab-ctl tail        # 查看日志
gitlab-ctl --help #查看更多命令

 

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
要在CentOS 7上部署GitLab CI持续集成,您可以按照以下步骤进行操作: 1. 安装GitLab的依赖项,包括curl、openssh-server、openssh-clients、postfix和policycoreutils。您可以使用以下命令进行安装: ``` yum install -y curl openssh-server openssh-clients postfix policycoreutils ``` 2. 下载GitLab的yum源并进行安装。您可以使用以下命令下载并安装yum源: ``` curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash ``` 3. 安装GitLab CE: ``` yum install -y gitlab-ce ``` 4. 进行GitLab的配置。这一步可能需要一些时间,请耐心等待: ``` gitlab-ctl reconfigure ``` 5. 安装GitLab插件。进入系统管理页面,点击"管理插件",并选择安装gitlab-plugin和gitlab hook-plugin。如果找不到这些插件,只需安装gitlabgitlab hook即可。 完成上述步骤后,您的CentOS 7系统就可以部署GitLab CI持续集成了。 <span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Cento7部署基于Jenkins和Gitlab的持续集成与部署架构](https://blog.csdn.net/xixixilalalahaha/article/details/106546320)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [CentOS 7 部署Gitlab+Jenkins持续集成(CI)环境](https://blog.csdn.net/a790308/article/details/102258147)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值