gitlab

gitlab(代码仓库)

gitlab的部署

下载gitlab的rpm包

[root@czh ~]# wget https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-13.12.3-ce.0.el8.x86_64.rpm/download.rpm

下载相关的依赖

[root@czh ~]# dnf -y install policycoreutils-python-utils curl openssh-server openssh-clients postfix cronie git

关闭防火墙

[root@czh ~]# systemctl stop firewalld
[root@czh ~]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@czh ~]# setenforce 0
[root@czh ~]# sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

启动postfix服务并设置开机自启

[root@czh ~]#  systemctl restart postfix
[root@czh ~]# systemctl enable postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.

安装gitlab

[root@czh ~]# gitlab-ce-13.12.3-ce.0.el8.x86_64.rpm
   1:gitlab-ce-13.12.3-ce.0.el8       ################################# [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-12

修改配置文件

[root@czh ~]# vim /etc/gitlab/gitlab.rb
……
external_url 'http://192.168.31.140'
……

重载配置文件 并重启gitlab

[root@czh ~]# gitlab-ctl reconfigure
[root@czh ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 18403) 0s
ok: run: gitaly: (pid 18450) 1s
ok: run: gitlab-exporter: (pid 18541) 0s
ok: run: gitlab-workhorse: (pid 18543) 0s
ok: run: grafana: (pid 18550) 1s
ok: run: logrotate: (pid 18614) 0s
ok: run: nginx: (pid 18652) 0s
ok: run: node-exporter: (pid 18661) 0s
ok: run: postgres-exporter: (pid 18665) 1s
ok: run: postgresql: (pid 18813) 0s
ok: run: prometheus: (pid 18826) 0s
ok: run: puma: (pid 18900) 1s
ok: run: redis: (pid 18945) 0s
ok: run: redis-exporter: (pid 18955) 1s
ok: run: sidekiq: (pid 19193) 0s
[root@czh ~]# ss -antl
State    Recv-Q   Send-Q     Local Address:Port       Peer Address:Port   Process   
LISTEN   0        1024           127.0.0.1:9236            0.0.0.0:*                
LISTEN   0        128              0.0.0.0:22              0.0.0.0:*                
LISTEN   0        100            127.0.0.1:25              0.0.0.0:*                
LISTEN   0        511              0.0.0.0:8060            0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9121            0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9090            0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9187            0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9093            0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9100            0.0.0.0:*                
LISTEN   0        1024           127.0.0.1:9229            0.0.0.0:*                
LISTEN   0        128            127.0.0.1:9168            0.0.0.0:*                
LISTEN   0        511              0.0.0.0:80              0.0.0.0:*                
LISTEN   0        128                 [::]:22                 [::]:*                
LISTEN   0        100                [::1]:25                 [::]:*                
LISTEN   0        1024                   *:9094                  *:*                
LISTEN   0        128                [::1]:9168               [::]:*  

修改密码

[root@czh ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
 GitLab:       13.12.3 (757327a59bc) FOSS
 GitLab Shell: 13.18.0
 PostgreSQL:   12.6
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.6)
irb(main):001:0> user = User.where(id: 1).first    id为1的是超级管理员
=> #<User id:1 @root>
irb(main):002:0> user.password = 'chenzihan123456'      密码必须至少8个字符
=> "chenzihan123456"
irb(main):003:0> user.password_confirmation = 'chenzihan123456'
=> "chenzihan123456"
irb(main):004:0> user.save!             保存修改,若无问题将返回true
Enqueued ActionMailer::MailDeliveryJob (Job ID: 5164a09e-652c-471f-a687-6bc2755c76bd) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f3c5295efd0 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):006:0> exit

在网页上登录
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值