gitlab
版本控制介绍
版本控制是指对软件开发过程中各种程序代码、配置文件及说明文档等文件变更的管理,是软件配置管理的核心思想之一。
版本控制最主要的功能就是追踪文件的变更。它将什么时候、什么人更改了文件的什么内容等信息忠实地了记录下来。每一次文件的改变,文件的版本号都将增加。除了记录版本变更外,版本控制的另一个重要功能是并行开发。软件开发往往是多人协同作业,版本控制可以有效地解决版本的同步以及不同开发者之间的开发通信问题,提高协同开发的效率。并行开发中最常见的不同版本软件的错误(Bug)修正问题也可以通过版本控制中分支与合并的方法有效地解决
配置gitlab
下载gitlab的rpm包
[root@host ~]# 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@host ~]# dnf -y install policycoreutils-python-utils curl openssh-server openssh-clients postfix cronie git
关闭防火墙和selinux并开启邮箱服务
[root@host ~]# systemctl enable postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@host ~]# systemctl start postfix
[root@host ~]# systemctl stop firewalld.service
[root@host ~]# setenforce 0
[root@host ~]# sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
安装gitlab
[root@host ~]# rpm -ivh download.rpm
警告:download.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY
Verifying... ################################# [100%]
准备中... ################################# [100%]
正在升级/安装...
1:gitlab-ce-13.12.3-ce.0.el8 ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
有这个标志就代表安装成功了
修改配置文件
sed -i "s#^external_url 'http://gitlab.example.com'#external_url 'http://192.168.149.140'#g" /etc/gitlab/gitlab.rb
重新读取配置文件并重启gitlab
[root@host ~]# gitlab-ctl reconfigure
[root@host ~]# gitlab-ctl restart
[root@host ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
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 511 0.0.0.0:80 0.0.0.0:*
LISTEN 0 128 127.0.0.1:9168 0.0.0.0:*
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 1024 127.0.0.1:3000 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 *:9094 *:*
LISTEN 0 128 [::1]:9168 [::]:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 100 [::1]:25 [::]:*
修改密码
[root@host ~]# 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>
irb(main):002:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):003:0> user.password = 'xialuo123'
=> "xialuo123"
irb(main):004:0> user.password_confirmation = 'xialuo123'
=> "xialuo123"
irb(main):005:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 789dcf9b-f042-4b78-961f-893365f3a020) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007fa47ce61838 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):006:0> exit
gitlab的web页面
根据自己的需求去添加用户或者组等等一系列修改