gitlab

版本控制介绍

版本控制是指对软件开发过程中各种程序代码、配置文件及说明文档等文件变更的管理,是软件配置管理的核心思想之一。

版本控制最主要的功能就是追踪文件的变更。它将什么时候、什么人更改了文件的什么内容等信息忠实地了记录下来。每一次文件的改变,文件的版本号都将增加。除了记录版本变更外,版本控制的另一个重要功能是并行开发。软件开发往往是多人协同作业,版本控制可以有效地解决版本的同步以及不同开发者之间的开发通信问题,提高协同开发的效率。并行开发中最常见的不同版本软件的错误(Bug)修正问题也可以通过版本控制中分支与合并的方法有效地解决。
具体来说,在每一项开发任务中,都需要首先设定开发基线,确定各个配置项的开发初始版本,在开发过程中,开发人员基于开发基线的版本,开发出所需的目标版本。当发生需求变更时,通过对变更的评估,确定变更的影响范围,对被影响的配置项的版本进行修改,根据变更的性质使配置项的版本树继续延伸或产生新的分支,形成新的目标版本,而对于不受变更影响的配置项则不应发产生变动。同时,应能够将变更所产生的对版本的影响进行记录和跟踪。必要时还可以回退到以前的版本。例如当开发需求或需求变更被取消时,就需要有能力将版本回退到开发基线版本。在曾经出现过的季度升级包拆包和重新组包的过程中,其实就是将部分配置项的版本回退到开发基线,将对应不同需求的不同分支重新组合归并,形成新的升级包版本。
版本控制是软件配置管理的核心功能。所有置于配置库中的元素都应自动予以版本的标识,并保证版本命名的唯一性。版本在生成过程中,自动依照设定的使用模型自动分支、演进。除了系统自动记录的版本信息以外,为了配合软件开发流程的各个阶段。还需要定义、收集一些元数据来记录版本的辅助信息和规范开发流程,并为今后对软件过程的度量做好准备。当然如果选用的工具支持,这些辅助数据将能直接统计出过程数据,从而方便软件过程改进活动的进行。对于配置库中的各个基线控制项,应该根据其基线的位置和状态来设置相应的访问权限。一般来说,对于基线版本之前的各个版本都应处于被锁定的状态,如需要对它们进行变更,则应按照变更控制的流程来进行操作。

常用的版本控制工具

  • gitlab
  • subversion

gitlab部署

安装git工具包

[root@localhost ~]# dnf -y install git

安装依赖包
[root@localhost ~]# yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python
上次元数据过期检查:7:17:07 前,执行于 20210608日 星期二 233456秒。
软件包 curl-7.61.1-17.el8.x86_64 已安装。
软件包 openssh-server-8.0p1-5.el8.x86_64 已安装。
软件包 openssh-clients-8.0p1-5.el8.x86_64 已安装。
软件包 cronie-1.5.2-4.el8.x86_64 已安装。
未找到匹配的参数: policycoreutils-python
错误:没有任何匹配: policycoreutils-python
//解决没有这个包
[root@localhost ~]# dnf -y install postfix
//首先先把邮件的包装上

[root@localhost ~]# dnf list all | grep policycoreutils
python3-policycoreutils

然后再安装上面的这个包
[root@localhost ~]# dnf -y install python3-policycoreutils

安装完成相应的依赖包之后,要把邮箱服务设置开机自启

[root@localhost ~]# systemctl enable --now postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@localhost ~]# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2021-06-09 06:56:45 EDT; 20s ago

//查看一下邮箱的端口号
[root@localhost ~]# ss -antl
State     Recv-Q    Send-Q         Local Address:Port         Peer Address:Port    Process    
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         128                     [::]:22                   [::]:*                  
LISTEN    0         100                    [::1]:25                   [::]:*     

接下来下载gitlab的rpm包
gitlab的rpm包(直接点击就可以下载)

安装gitlab的rpm包

[root@localhost ~]# rpm -ivh gitlab-ce-13.9.7-ce.0.el8.x86_64.rpm 


警告:gitlab-ce-13.9.7-ce.0.el8.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:gitlab-ce-13.9.7-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-9


//更改配置文件
[root@localhost ~]# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.98.123'


//看到这个说明配置完成了,在查看一下端口号,发现多出来了很多端口

[root@localhost ~]# gitlab-ctl reconfigure

Notes:
It seems you haven't specified an initial root password while configuring the GitLab instance.
On your first visit to  your GitLab instance, you will be presented with a screen to set a
password for the default admin account with username `root`.

gitlab Reconfigured!


[root@localhost ~]# ss -antl
State     Recv-Q    Send-Q         Local Address:Port         Peer Address:Port    Process    
LISTEN    0         128                127.0.0.1:8082              0.0.0.0:*                  
LISTEN    0         128                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               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         1024               127.0.0.1:8080              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@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 172848) 0s
ok: run: gitaly: (pid 172971) 0s
ok: run: gitlab-exporter: (pid 173077) 0s
ok: run: gitlab-workhorse: (pid 173081) 0s
ok: run: grafana: (pid 173110) 1s
ok: run: logrotate: (pid 173137) 0s
ok: run: nginx: (pid 173171) 1s
ok: run: node-exporter: (pid 173194) 0s
ok: run: postgres-exporter: (pid 173313) 1s
ok: run: postgresql: (pid 173436) 0s
ok: run: prometheus: (pid 173465) 0s
ok: run: puma: (pid 173515) 0s
ok: run: redis: (pid 173540) 0s
ok: run: redis-exporter: (pid 173586) 1s
ok: run: sidekiq: (pid 174105) 0s

重启之后关闭防火墙和setenfore
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0

接下来就可以访问页面了

在这里插入图片描述

为gitlab设置密码(也称为破解密码)

//进入gitlab密码编辑
[root@localhost ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
 GitLab:       13.9.7 (05f9b5a73c8) FOSS
 GitLab Shell: 13.17.0
 PostgreSQL:   12.6
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.4)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = "071216zdj"
=> "071216zdj"
irb(main):003:0> user.password_confirmation = "071216zdj"
=> "071216zdj"
irb(main):004:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: ed0cbbfb-5445-4925-be2a-028f1402203a) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f2ec2cdb4a8 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
设置密码完成,现在用设置的密码登录

在这里插入图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
# 1、下载rpm源文件 * rpm下载不了的文件可以到[rpm官方](http://rpm.pbone.net/)进行下载 # 2、执行rpm文件 * 1、以下的rpm文件是有依赖,需要安装顺序进行执行. * 2、执行policycoreutils-python-2.5-29.el7.x86_64.rpm发现报 错误:依赖检测失败: policycoreutils = 2.5-22.el7 被 policycoreutils-python-2.5-22.el7.x86_64 需要 去rpm官方网找了一个`policycoreutils-python-2.5-29.el7_6.1.x86_64.rpm`最新的安装包执行安装 * 3、python-kitchen-1.1.1-5.el7.noarch.rpm可以不需要安装 ``` rpm -ivh libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm rpm -ivh audit-libs-python-2.8.4-4.el7.x86_64.rpm rpm -ivh libcgroup-0.41-20.el7.x86_64.rpm rpm -ivh libsemanage-python-2.5-14.el7.x86_64.rpm rpm -ivh checkpolicy-2.5-8.el7.x86_64.rpm rpm -ivh python-IPy-0.75-6.el7.noarch.rpm rpm -ivh setools-libs-3.3.8-4.el7.x86_64.rpm rpm -ivh policycoreutils-python-2.5-29.el7_6.1.x86_64.rpm rpm -ivh container-selinux-2.74-1.el7.noarch.rpm rpm -ivh libseccomp-2.3.1-3.el7.x86_64.rpm rpm -ivh containerd.io-1.2.0-3.el7.x86_64.rpm rpm -ivh docker-ce-cli-18.09.0-3.el7.x86_64.rpm rpm -ivh docker-ce-18.09.0-3.el7.x86_64.rpm ``` # 3、启动docker ``` systemctl daemon-reload && systemctl restart docker ``` # 4、设置开机启动 * Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. ``` systemctl enable docker.service ``` # 5、验证docker ``` docker version ``` # 参考文章 * [CentOS 7.5离线安装Docker 18.09.3软件](https://jingyan.baidu.com/article/fb48e8becf31a16e632e145f.html)

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值