gitlb部署

12 篇文章 0 订阅

gitlb部署



安装依赖包

[root@localhost ~]# dnf -y install curl openssh-server openssh-clients postfix cronie git


# 启动postfix服务并设置开机自启
[root@localhost ~]# systemctl enable --now postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.

下载gitlab的rpm包

[root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.2.2-ce.0.el7.x86_64.rpm 
[root@localhost ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/policycoreutils-python-2.5-34.el7.x86_64.rpm


[root@localhost ~]# rpm -ivh --nodeps policycoreutils-python-2.5-34.el7.x86_64.rpm 
warning: policycoreutils-python-2.5-34.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:policycoreutils-python-2.5-34.el7################################# [100%]
   
[root@localhost ~]# rpm -ivh --nodeps gitlab-ce-15.2.2-ce.0.el7.x86_64.rpm 
warning: gitlab-ce-15.2.2-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:gitlab-ce-15.2.2-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=15-2

修改配置文件

[root@localhost ~]# vim /etc/gitlab/gitlab.rb
...(省略)
external_url 'http://192.168.10.101'    # 设为gitlab服务器的IP地址或者域名
...(省略)

重载配置文件并重启gitlab

[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 6647) 1s
ok: run: gitaly: (pid 6660) 0s
ok: run: gitlab-exporter: (pid 6674) 0s
ok: run: gitlab-kas: (pid 6676) 0s
ok: run: gitlab-workhorse: (pid 6684) 0s
ok: run: grafana: (pid 6692) 0s
ok: run: logrotate: (pid 6705) 1s
ok: run: nginx: (pid 6715) 0s
ok: run: node-exporter: (pid 6721) 1s
ok: run: postgres-exporter: (pid 6727) 0s
ok: run: postgresql: (pid 6821) 1s
ok: run: prometheus: (pid 6830) 0s
ok: run: puma: (pid 6841) 0s
ok: run: redis: (pid 6846) 0s
ok: run: redis-exporter: (pid 6852) 0s
ok: run: sidekiq: (pid 6861) 0s

查看当前的gitlab版本

[root@localhost ~]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 15.2.2

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8gf70UpX-1660173958472)(E:\App\Typora\Typora\picture\image-20220810190716475.png)]


破解管理员密码

[root@localhost ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
 GitLab:       15.2.2 (4ecb014a935) FOSS
 GitLab Shell: 14.9.0
 PostgreSQL:   13.6
------------------------------------------------------------[ booted in 28.22s ]
Loading production environment (Rails 6.1.4.7)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = '12345678'
=> "12345678"
irb(main):003:0> user.password_confirmation = '12345678'
=> "12345678"
irb(main):004:0> user.save!
=> true
irb(main):005:0> exit

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-tbS6exDR-1660173958473)(E:\App\Typora\Typora\picture\image-20220810191059289.png)]
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值