gitlab
gitlab(版本控制)
简介
版本控制是指对软件开发过程中各种程序代码、配置文件及说明文档等文件变更的管理,是软件配置管理的核心思想之一。
版本控制最主要的功能就是追踪文件的变更。它将什么时候、什么人更改了文件的什么内容等信息忠实地了记录下来。每一次文件的改变,文件的版本号都将增加。
除了记录版本变更外,版本控制的另一个重要功能是并行开发。软件开发往往是多人协同作业,版本控制可以有效地解决版本的同步以及不同开发者之间的开发通信问题,提高协同开发的效率。并行开发中最常见的不同版本软件的错误(Bug)修正问题也可以通过版本控制中分支与合并的方法有效地解决。 具体来说,在每一项开发任务中,都需要首先设定开发基线,确定各个配置项的开发初始版本,在开发过程中,开发人员基于开发基线的版本,开发出所需的目标版本。当发生需求变更时,通过对变更的评估,确定变更的影响范围,对被影响的配置项的版本进行修改,根据变更的性质使配置项的版本树继续延伸或产生新的分支,形成新的目标版本,而对于不受变更影响的配置项则不应发产生变动。同时,应能够将变更所产生的对版本的影响进行记录和跟踪。必要时还可以回退到以前的版本。例如当开发需求或需求变更被取消时,就需要有能力将版本回退到开发基线版本。在曾经出现过的季度升级包拆包和重新组包的过程中,其实就是将部分配置项的版本回退到开发基线,将对应不同需求的不同分支重新组合归并,形成新的升级包版本。 版本控制是软件配置管理的核心功能。所有置于配置库中的元素都应自动予以版本的标识,并保证版本命名的唯一性。版本在生成过程中,自动依照设定的使用模型自动分支、演进。除了系统自动记录的版本信息以外,为了配合软件开发流程的各个阶段。还需要定义、收集一些元数据来记录版本的辅助信息和规范开发流程,并为今后对软件过程的度量做好准备。当然如果选用的工具支持,这些辅助数据将能直接统计出过程数据,从而方便软件过程改进活动的进行。对于配置库中的各个基线控制项,应该根据其基线的位置和状态来设置相应的访问权限。一般来说,对于基线版本之前的各个版本都应处于被锁定的状态,如需要对它们进行变更,则应按照变更控制的流程来进行操作。
部署
[root@localhost ~]# systemctl disable --now firewalld.service Removed /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@localhost ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted 安装epel-reseale源 [root@localhost ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm --2021-10-12 12:20:24-- https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm 正在解析主机 dl.fedoraproject.org (dl.fedoraproject.org)... 38.145.60.23, 38.145.60.22, 38.145.60.24 正在连接 dl.fedoraproject.org (dl.fedoraproject.org)|38.145.60.23|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:23644 (23K) [application/x-rpm] 正在保存至: “epel-release-latest-8.noarch.rpm” epel-release-latest-8 100%[======================>] 23.09K 37.0KB/s 用时 0.6s 2021-10-12 12:20:26 (37.0 KB/s) - 已保存 “epel-release-latest-8.noarch.rpm” [23644/23644]) [root@localhost ~]# rpm -vih epel-release-latest-8.noarch.rpm 警告:epel-release-latest-8.noarch.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 2f86d6a1: NOKEY Verifying... ################################# [100%] 准备中... ################################# [100%] 正在升级/安装... 1:epel-release-8-13.el8 ################################# [100%] 安装git [root@localhost ~]# yum -y install epel-release git 安装依赖包 [root@localhost ~]# yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python-utils 下载gitlab的rpm包 [root@localhost ~]# cd /usr/src/ [root@localhost src]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm --2021-10-12 12:22:26-- https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm 正在解析主机 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2 正在连接 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:961561901 (917M) [application/x-redhat-package-manager] 正在保存至: “gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm” gitlab-ce-14.3.2-ce.0 100%[======================>] 917.02M 5.64MB/s 用时 3m 41s 2021-10-12 12:26:12 (4.15 MB/s) - 已保存 “gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm” [961561901/961561901]) [root@localhost src]# rpm -ivh gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm 警告:gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY Verifying... ################################# [100%] 准备中... ################################# [100%] 正在升级/安装... 1:gitlab-ce-14.3.2-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=14-3 修改配置文件 [root@localhost ~]# vim /etc/gitlab/gitlab.rb 32 external_url 'http://192.168.145.169' 启动postfix服务并设置开机自启 [root@localhost ~]# systemctl enable --now postfix.service Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service. 重载配置文件并重启gitlab [root@localhost ~]# gitlab-ctl reconfigure ...过程省略 [root@localhost ~]# gitlab-ctl restart ok: run: alertmanager: (pid 69109) 0s ok: run: gitaly: (pid 69143) 1s ok: run: gitlab-exporter: (pid 69176) 0s ok: run: gitlab-workhorse: (pid 69181) 0s ok: run: grafana: (pid 69189) 0s ok: run: logrotate: (pid 69219) 0s ok: run: nginx: (pid 69225) 0s ok: run: node-exporter: (pid 69261) 1s ok: run: postgres-exporter: (pid 69279) 0s ok: run: postgresql: (pid 69300) 1s ok: run: prometheus: (pid 69311) 0s ok: run: puma: (pid 69340) 0s ok: run: redis: (pid 69369) 0s ok: run: redis-exporter: (pid 69394) 1s ok: run: sidekiq: (pid 69546) 0s

浙公网安备 33010602011771号