赞
踩
vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
# sudo命令以系统管理者的身份执行指令,也就是说,经由 sudo 所执行的指令就好像是 root 亲自执行
sudo yum makecache
sudo yum install -y gitlab-ce
vim /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure
执行完后截图如下
sudo gitlab-ctl start
常用命令
gitlab-ce 初装以后,把密码放在了一个临时文件中了
# cat /etc/gitlab/initial_root_password
Password: ARVVjpDcF5g/ZG2DScarmU9s9TKUT09HQd3qUj4jq/c=
这个文件将在首次执行reconfigure后24小时自动删除
<root@gitlab ~># cd /opt/gitlab/bin
<root@gitlab bin># gitlab-rails console -e production #等待ruby控制台出来,时间还是挺长的!
Ruby: ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
GitLab: 14.4.1 (1a23d731c9f) FOSS
GitLab Shell: 13.21.1
Loading production environment (Rails 6.1.4.1)
irb(main):001:0> u=User.where(id:1).first
=> #<User id:1 @root>
irb(main):002:0> User.all
=> #<ActiveRecord::Relation [#<User id:1 @root>]>
irb(main):003:0> u.password='12345678'
=> "12345678"
irb(main):004:0> u.password_confirmation='12345678'
=> "12345678"
irb(main):005:0> u.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 2e04113b-4441-4b96-b85d-b6d8f4adc582) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f31cb855aa8 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):006:0> exit
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。