版本控制gitlab

版本控制gitlab

什么是版本控制gitlab

GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的Web服务。安装方法是参考GitLab在GitHub上的Wiki页面。Gitlab是目前被广泛使用的基于git的开源代码管理平台, 基于Ruby on Rails构建, 主要针对软件开发过程中产生的代码和文档进行管理, Gitlab主要针对group和project两个维度进行代码和文档管理, 其中group是群组, project是工程项目, 一个group可以管理多个project, 可以理解为一个群组中有多项软件开发任务, 而一个project中可能包含多个branch, 意为每个项目中有多个分支, 分支间相互独立, 不同分支可以进行归并。

常用的版本控制工具:

  • gitlab
  • subversion

gitlab部署

部署需要至少4GB内存运行,如果不够尽量调制最高,方便后面编译

阿里云镜像源

#配置yum源
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# rm -rf *
[root@localhost yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
[root@localhost yum.repos.d]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@localhost yum.repos.d]# yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
[root@localhost yum.repos.d]# sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
[root@localhost yum.repos.d]# sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*

#关闭防火墙和selinux
[root@localhost ~]# setenforce 0
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
[root@localhost ~]# systemctl disable --now firewalld

下载gitlab的包

下载policycoreutils-python依赖包

下载地址

版本控制gitlab

版本控制gitlab

清华大学开源软件镜像站

下载gitlab-ce包

版本控制gitlab
#卸载依赖包
[root@localhost ~]# dnf -y remove policycoreutils

#下载包
[root@localhost ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/policycoreutils-python-2.5-34.el7.x86_64.rpm
[root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm
[root@localhost ~]# ls
anaconda-ks.cfg  gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm  policycoreutils-python-2.5-34.el7.x86_64.rpm

[root@localhost ~]# yum -y install epel-release git
[root@localhost ~]# yum -y install curl openssh-server openssh-clients postfix cronie perl
#安装policycoreutils-python
[root@localhost ~]# rpm -ivh --nodeps policycoreutils-python-2.5-34.el7.x86_64.rpm
warning: policycoreutils-python-2.5-34.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...

   1:policycoreutils-python-2.5-34.el7################################# [100%]

#安装gitlab-ce
[root@localhost ~]# rpm -ivh gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm
warning: gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...

   1:gitlab-ce-15.3.3-ce.0.el7        ################################# [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=15-3

#启动postfix服务
[root@localhost ~]# systemctl enable --now postfix

#修改配置文件
[root@localhost ~]# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.111.139'       //修改为主机IP

#重新配置需要等待一段时间
[root@localhost ~]# export LANG=en_US.UTF-8
[root@localhost ~]# bash
[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# ss -anlt
State            Recv-Q           Send-Q                       Local Address:Port                       Peer Address:Port           Process
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                1024                             127.0.0.1:8150                            0.0.0.0:*
LISTEN           0                128                                0.0.0.0:22                              0.0.0.0:*
LISTEN           0                1024                             127.0.0.1:8151                            0.0.0.0:*
LISTEN           0                1024                             127.0.0.1:8153                            0.0.0.0:*
LISTEN           0                100                              127.0.0.1:25                              0.0.0.0:*
LISTEN           0                1024                             127.0.0.1:8154                            0.0.0.0:*
LISTEN           0                1024                             127.0.0.1:8155                            0.0.0.0:*
LISTEN           0                128                              127.0.0.1:8092                            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                128                                  [::1]:9168                               [::]:*
LISTEN           0                128                                   [::]:22                                 [::]:*
LISTEN           0                100                                  [::1]:25                                 [::]:*
LISTEN           0                1024                                     *:9094                                  *:*

[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 53289) 0s
ok: run: gitaly: (pid 53373) 1s
ok: run: gitlab-exporter: (pid 53415) 0s
ok: run: gitlab-kas: (pid 53417) 1s
ok: run: gitlab-workhorse: (pid 53451) 0s
ok: run: logrotate: (pid 53463) 0s
ok: run: nginx: (pid 53469) 1s
ok: run: node-exporter: (pid 53552) 0s
ok: run: postgres-exporter: (pid 53561) 1s
ok: run: postgresql: (pid 53596) 0s
ok: run: prometheus: (pid 53611) 1s
ok: run: puma: (pid 53647) 0s
ok: run: redis: (pid 53728) 0s
ok: run: redis-exporter: (pid 53734) 1s
ok: run: sidekiq: (pid 53959) 0s

#查看当前的gitlab版本
[root@localhost ~]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 15.3.3

#破解管理员密码
[root@localhost ~]# gitlab-rails console -e production
Loading production environment (Rails 6.1.6.1)
irb(main):001:0> user = User.where(id: 1).first
=> #<user id:1 @root>
irb(main):002:0> user.password = '12345678'
=> "12345678"
irb(main):003:0> user.password_confirmation = '12345678'
=> "12345678"
irb(main):004:0> user.save!

=> true
irb(main):005:0> exit
</user>

访问网页

版本控制gitlab

版本控制gitlab

Original: https://www.cnblogs.com/Their-own/p/16721275.html
Author: 事愿人为
Title: 版本控制gitlab

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/573886/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • .Net中Aspose组件调试技巧

    | 0.48分钟 | 774.4字符 | 1、引言&背景 2、水印或截断问题解决 3、即时调试的技巧 4、声明与参考资料 | SCscHero | 2022/6/4 PM2…

    Linux 2023年6月13日
    076
  • MIT6.828——Lab1 partA(麻省理工操作系统课程实验)

    Lab1 基本部分 在实验给出的文档中,已经详说明了早期PC的内存布局,并且运行了 bootloader。详细地解释了,上电后BIOS所做的工作,因此这部分不再赘述。需要注意的是 …

    Linux 2023年5月27日
    0167
  • 关闭linux内核反向路由

    route -n Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0….

    Linux 2023年6月8日
    0101
  • 梦幻西游H5游戏超详细图文架设教程

    前言 想体验经典Q版西游霸服快乐吗?想体验满级VIP的尊贵吗?想体验一招秒杀的爽快吗?各种极品装备、翅膀、宠物通通给你,就在梦幻西游! 本文讲解梦幻西游H5游戏的架设教程,想研究H…

    Linux 2023年6月7日
    0105
  • 剑指offer计划21( 位运算简单)—java

    1.1、题目1 剑指 Offer 15. 二进制中1的个数 1.2、解法 通过判断每一位的与来识别1的数量。 1.3、代码 public class Solution { // y…

    Linux 2023年6月11日
    0125
  • 网络扫描(二)

    免责声明:本文所述工具只用于网络安全的学习与研究。严禁任何阅读本文的读者利用本文所述工具进行违法犯罪活动。如有任何法律纠纷本文作者概不负责。 上一篇博文讲到了fping工具和nma…

    Linux 2023年6月14日
    092
  • TCP三次握手与四次挥手

    什么是三次握手? 一般情况下,连接是由客户端向服务端发起的。 第一次,客户端发送一个TCP数据报并将SYN同步位置为1,表示要建立连接,此时客户端会从CLOSED状态变为SYN_S…

    Linux 2023年6月8日
    0102
  • Nginx—location配置

    Nginx—location配置 编辑nginx.conf文件 #user nobody; worker_processes 1; #error_log logs/error.lo…

    Linux 2023年6月11日
    089
  • phpcms v9全站点击量排行代码

    前台: {pc:content action=”sitehits” siteid=”1″ num=”10″ …

    Linux 2023年6月13日
    077
  • Spring Boot 项目部署到 Linux服务器

    1.首先将SpringBoot项目打包成JAR包,然后通过FTP工具上传到Linux,执行如下命令: java -jar xxx.jar & 该命令执行后,启动jar,一旦…

    Linux 2023年6月14日
    070
  • docker 启动mysql

    创建配置文件 mysqld.cnf Original: https://www.cnblogs.com/outsrkem/p/15704614.htmlAuthor: Outsrk…

    Linux 2023年6月6日
    068
  • linux系统基于新磁盘和同磁盘其他分区的目录扩容

    linux系统基于新磁盘和同磁盘其他分区的目录扩容 (1) 基于新建磁盘目录扩容 例如:新增1 块3G 的磁盘sdb ,扩容/tmp 至13G pvcreate /dev/sdb1…

    Linux 2023年6月13日
    0100
  • 网络安全之浅谈攻击

    最近大家也关注到了新闻,USA又对我国的一些总要的事业单位和网络基础设施进行的非法的攻击和渗透,窃取了大量的数据。可见看似和平静的水面,其实一直都是暗藏波涛,网络安全又被提摆到公众…

    Linux 2023年6月6日
    078
  • OpenSSL测试-随机数

    任务详情 在openEuler(推荐)或Ubuntu或Windows(不推荐)中完成下面任务 使用OpenSSL定义一个私有函数 static int getRandom(char…

    Linux 2023年6月8日
    098
  • prometheus监控

    介绍 Prometheus是一个开源监控系统,它前身是SoundCloud的警告工具包。从2012年开始,许多公司和组织开始使用Prometheus。该项目的开发人员和用户社区非常…

    Linux 2023年6月6日
    097
  • linux下启动MongoDB权限不够

    bash: ./mongod: 权限不够 解决办法: 在MongoDB安装目录下: chmod -R 740 bin Original: https://www.cnblogs.c…

    Linux 2023年6月14日
    081
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球