版本控制gitlab

版本控制gitlab

版本控制定义:

是指对软件开发过程中各种程序代码、配置文件及说明文档等文件变更的管理

版本控制功能

1.追踪文件的变更
2.并行开发
3.有效地解决版本的同步以及不同开发者之间的开发通信问题,提高协同开发的效率
版本控制是软件配置管理的核心功能。

版本控制工具

gitlab
subversion

gitlab部署

配置yum源
[root@arongya ~]# cd /etc/yum.repos.d/
[root@arongya yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2018-09-04 17:58:12--  http://mirrors.163.com/.help/CentOS7-Base-163.repo
Resolving mirrors.163.com (mirrors.163.com)... 59.111.0.251
Connecting to mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1572 (1.5K) [application/octet-stream]
Saving to: ‘CentOS7-Base-163.repo’

100%[===========================>] 1,572       --.-K/s   in 0.001s  

2018-09-04 17:58:13 (1.45 MB/s) - ‘CentOS7-Base-163.repo’ saved [1572/1572]
[root@arongya yum.repos.d]# sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS7-Base-163.repo 
[root@arongya yum.repos.d]# sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/CentOS7-Base-163.repo 
[root@arongya yum.repos.d]# yum -y install epel-release

安装git

[root@arongya ~]# yum -y install epel-release git

安装依赖包

[root@arongya ~]# yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python

启动postfix服务并设置开机自启

[root@arongya ~]# systemctl restart postfix
[root@arongya ~]# systemctl enable postfix

下载gitlab的rpm包

[root@arongya ~]# cd /usr/src/
[root@arongya src]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm
[root@arongya src]# ls
debug  gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm  kernels

安装gitlab

[root@arongya src]# rpm -ivh gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm
warning: gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:gitlab-ce-11.2.1-ce.0.el7        ################################# [100%]
It looks like Gi tLab 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

修改配置文件

[root@arongya src]# vim /etc/gitlab/gitlab.rb 
...//此处为省略内容
external_url 'http://gitlab.example.com'修改成
external_url 'http://192.168.228.30'
....//此处为省略内容

重载配置文件并重启gitlab

[root@arongya src]# gitlab-ctl reconfigure
[root@arongya src]# gitlab-ctl restart

查看当前的gitlab版本

扫描二维码关注公众号,回复: 3112408 查看本文章
[root@arongya src]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 11.2.1

设置管理员密码


[root@arongya ~]# gitlab-rails console production
-------------------------------------------------------------------------------------
 GitLab:       11.2.1 (2d6c1c6)
 GitLab Shell: 8.1.1
 postgresql:   9.6.8
-------------------------------------------------------------------------------------
Loading production environment (Rails 4.2.10)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>    //id为1的是超级管理员
irb(main):002:0> user.password = 'yaoxiaorong!'
=> "yaoxiaorong!"   //密码必须至少8个字符
irb(main):003:0> user.save!   //保存修改,若无问题将返回true
Enqueued ActionMailer::DeliveryJob (Job ID: 41178696-d346-4b3b-8c34-7215f3bb5b5a) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
irb(main):004:0> exit   //退出

gitlab管理

在浏览器中使用gitlab服务器的IP访问,页面如下图所示
这里写图片描述
这里写图片描述
创建新用户
这里写图片描述
这里写图片描述
这里写图片描述
其他
这里写图片描述

猜你喜欢

转载自blog.csdn.net/zzs183yxr_zzs/article/details/82389119