centeros安装gitlab

开启配置

  • 在CentOS系统上,打开系统防火墙HTTP和SSH的访问
[root@code ~]# yum install -y curl policycoreutils-python openssh-server
[root@code ~]# systemctl enable sshd
[root@code ~]# systemctl start sshd
[root@code ~]# firewall-cmd --permanent --add-service=http
[root@code ~]# systemctl reload firewalld

  • 安装Postfix,用来发送邮件,在安装Postfix的过程中选择’Internet Site’
[root@code ~]# yum install postfix
[root@code ~]# systemctl enable postfix
[root@code ~]# systemctl start postfix

添加GitLab镜像仓库并安装

  • 使用官方镜像安装
$ curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

$ EXTERNAL_URL="http://code.local.com" yum install -y gitlab-ce

账号初始化

  • 初始化管理员账号(root)
[root@web1 ~]# gitlab-rails console  -e  production
-------------------------------------------------------------------------------------
 Gitlab:       13.0.5 (2268d0cdfcds) FOSS
 Gitlab Shell: 13.2.0
 postgresql:   11.7
-------------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3)
irb(main):001:0>  user = User.where(id: 1).first    
=> #<User id:1 @root>
irb(main):002:0> user.password="admin12345678"
=> "admin12345678"
irb(main):003:0> user.password_confirmation=“admin12345678"
=> "admin12345678"
irb(main):004:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 3ef37c47-4b3f-49e5-aa53-904e725bd1a8) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
irb(main):005:0> quit

注:

gitlab-rails console  -e  production // 进入postgresql命令行
user = User.where(id: 1).first    // 查找第一个默认管理员root
user.password="admin12345678" // 设置密码为admin12345678
user.password="admin12345678" // 设置确认密码为admin12345678
  • 登陆

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值