gitlab

版本控制介绍

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

版本控制最主要的功能就是追踪文件的变更。

版本控制的另一个重要功能是并行开发。软件开发往往是多人协同作业,版本控制可以有效地解决版本的同步以及不同开发者之间的开发通信问题,提高协同开发的效率。

版本控制是软件配置管理的核心功能。

GitLab是利用 Ruby on Rails 一个开源的版本管理系统,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找

安装rpm包与依赖

[root@localhost ~]# 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@localhost ~]# dnf -y install policycoreutils-python-utils curl openssh-server openssh-clients postfix cronie git

关闭防火墙、开启邮箱服务

[root@localhost ~]# systemctl enable postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@localhost ~]# systemctl start postfix
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

开始安装gitlab!

[root@localhost ~]#  rpm -ivh download.rpm 
警告:download.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f74eab86: 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.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
  

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-12

修改配置文件为本机ip,重新读取配置文件并重启服务

[root@localhost ~]# sed -i "s#^external_url 'http://gitlab.example.com'#external_url 'http://192.168.10.40'#g" /etc/gitlab/gitlab.rb

[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 51252) 0s
ok: run: gitaly: (pid 51295) 1s
ok: run: gitlab-exporter: (pid 51321) 0s
ok: run: gitlab-workhorse: (pid 51336) 1s
ok: run: grafana: (pid 51364) 0s
ok: run: logrotate: (pid 51412) 1s
ok: run: nginx: (pid 51450) 0s
ok: run: node-exporter: (pid 51463) 0s
ok: run: postgres-exporter: (pid 51468) 0s

查看端口号

[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@localhost ~]# 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> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = 'tjnr'
=> "tjnt"
irb(main):003:0> user.password_confirmation = 'tjnt'
=> "tjnt"
irb(main):004:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 36cdd4b3-19f5-4936-92e8-af0c6a4ed69f) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f91f2532470 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):005:0> exit

使用ip地址访问
在这里插入图片描述

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值