1.版本控制介绍
版本控制针对开发过程中的各种程序代码,配置文件,说明文档,文件的变更的合理管理,核心是软件配置的管理。
版本控制主要的功能是记录文件内的变更,文件的改变,文件的版本号都将增加,除了记录版本变更外,版本控制的另一个重要功能是和软件开发协同作业,版本控制可以有效的解决版本的同步以及不同开发者之间的开发通信问题,提高协同开发的效率,不同版本软件的bug错误可以通过版本控制中对端分支与合并的方法有效解决。
版本控制工具
gitlab
subversion
2.gitlab部署
最新linux环境
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
policycoreutils-python-utils.noarch 2.9-16.el8
[root@localhost ~]
[root@localhost src]
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@localhost ~]
[root@localhost src]
[root@localhost src]
debug gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm kernels
[root@localhost src]
警告:gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY
Verifying...
准备中...
正在升级/安装...
1:gitlab-ce-14.3.2-ce.0.el8
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. //显示请配置你的url
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 src]
external_url 'http://192.168.136.242' //改成你的本机ip
[root@localhost src]
Starting Chef Infra Client, version 15.17.4
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
- gitlab (0.0.1)
- package (0.1.0)
- logrotate (0.1.0)
- postgresql (0.1.0)
- redis (0.1.0)
- monitoring (0.1.0)
- registry (0.1.0)
- mattermost (0.1.0)
[root@localhost ~]
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
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 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 *:9094 *:*
LISTEN 0 128 [::1]:9168 [::]:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 100 [::1]:25 [::]:*
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
gitlab-ce 14.3.2
[root@localhost ~]
Password: JMJQNeTfLhpA5O0RpTavm6Fa/dOnr/K1G+5KejOJ4UI=
[root@localhost ~]
--------------------------------------------------------------------------------
Ruby: ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
GitLab: 14.3.2 (92acfb1b8a9) FOSS
GitLab Shell: 13.21.1
PostgreSQL: 12.7
irb(main):011:0> user = User.where(id: 1).first //用户是对于id=1的超级管理员
=>
irb(main):012:0> user.password = 'gitlab@@@' //设置密码,必须是八位以上
=> "gitlab@@@"
irb(main):013:0> user.password_confirmation = 'gitlab@@@' //再次确认密码
=> "gitlab@@@"
irb(main):014:0> user.save! //保存
Enqueued ActionMailer::MailDeliveryJob (Job ID: 45eb0c23-ffac-4eea-8eb2-274f003f18cf) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[
=> true
下载gitlab最新安装包:https://mirrors.bfsu.edu.cn/gitlab-ce/yum/el8/(外国语学校镜像源)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nFUhP0PY-1634226217984)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013111157.png)]](https://img-blog.csdnimg.cn/32e2308379d54ed99e36b5459d9f8b2f.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
访问gitlabweb界面
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-5QNkMfDh-1634226217988)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013115956.png)]](https://img-blog.csdnimg.cn/57de4736a4be45538578dd0947457383.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
3.gitlab界面创建用户和组
web界面管理介绍
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zTGrJ9R9-1634226217989)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013123852.png)]](https://img-blog.csdnimg.cn/49bb02520ffa49798b360143fe6510c3.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-h8RecnSY-1634226217991)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013124401.png)]](https://img-blog.csdnimg.cn/3b230b8bb2c5485d8e26dd0442fe4f14.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
用户操作

![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6jSJYTaz-1634226217995)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013130334.png)]](https://img-blog.csdnimg.cn/a43641cc42674d8ebbc81c2dc656686f.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
换另一个浏览器再次访问,用tom用户进行登录,会提示重新设置一个新的密码
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lqFkpggs-1634226217996)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013130742.png)]](https://img-blog.csdnimg.cn/e1b3b2cfa8cf49de8d59a5d357baa4ae.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-CYuJNeEr-1634226217997)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013131045.png)]](https://img-blog.csdnimg.cn/fd406910ae6345c199d41741c8ca1adc.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
用户的禁用以及再次编辑,一般情况下不会删除某个用户
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-sGHgFukL-1634226217998)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013131848.png)]](https://img-blog.csdnimg.cn/98e1b6ace21f4f919792c4170cb5bf49.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
创建组
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-BWkLz68o-1634226217998)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013132426.png)]](https://img-blog.csdnimg.cn/de39d58663f54df8b4be26180f51f8d7.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
添加用户到组
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pDAYFPB6-1634226217999)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013133146.png)]](https://img-blog.csdnimg.cn/ad0ad9b0a64e4b19a21b9d91d8d67c95.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
4.gitlab项目的介绍
4.1创建项目

![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-AvxOWG4p-1634226218001)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013134731.png)]](https://img-blog.csdnimg.cn/51bbef389fd943daa002231cfc25145f.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
4.2项目克隆到linux目录下(重要)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ErnzzzlW-1634226218001)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013135530.png)]](https://img-blog.csdnimg.cn/dce3c006d32243e2bab1e763277d4c63.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
[root@localhost opt]
/opt
[root@localhost opt]
[root@localhost opt]
gitlab gram
[root@localhost opt]
[root@localhost gram]
[root@localhost gram]
[root@localhost gram]
[root@localhost gram]
[root@localhost gram]
[root@localhost gram]
[root@localhost gram]
Username for 'http://192.168.136.242': root
Password for 'http://root@192.168.136.242':
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GX58wlcf-1634226218002)(C:\Users\鸡哥爱篮球\Pictures\gitlab\QQ截图20211013141739.png)]](https://img-blog.csdnimg.cn/f1324c8b3e544aeb829034dbec6cd22b.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56We5oWV6JSh6JSh,size_20,color_FFFFFF,t_70,g_se,x_16)
4.3发布,发版,上线的流程(生产环境)
发布需求由运营人员提出
开发人员按照需求开发代码,可以加需求,提交变更单(开发组长签字)
测试人员进行测试
1. 有问题:打回修复代码
2. 无问题:**让测试人员签字**(避免背锅)
运维人员
1.评估
2.汇报 (邮件方式还是避免背锅)
CTO 首席技术总监 (服从cto即可)
以上是大厂的流程
|