zoukankan      html  css  js  c++  java
  • 版本管控工具-gitlab

    版本管控工具-gitlab

    一、什么是GitLab

    GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。

    它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。

    GitLab 5.0以前版本要求服务器端采用 Gitolite 搭建,5.0版本以后不再使用 Gitolite ,采用自己开发的 gitlab-shell 来实现。如果你觉得安装麻烦可以使用 GitLab Installers 一键安装程序。

    二、前期准备

    2.1 安装文件下载

    2.1.1 下载地址:

    清华大学开源软件镜像站

    image-20210215164625492

    2.1.2 下载文件

    wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.8.4-ce.0.el7.x86_64.rpm
    

    注:el是Red Hat Enterprise Linux(EL)的缩写

    EL6是Red Hat 6.x,CentOS 6.x和CloudLinux 6.x的下载

    EL5是Red Hat 5.x,CentOS 5.x和CloudLinux 5.x的下载

    EL7是Red Hat 7.x,CentOS 7.x和CloudLinux 7.x的下载

    博主用的是CentOS 7.9,大家自行选用即可。

    三、相关依赖安装与配置

    3.1 防火墙的安装与配置

    #安装防火墙
    yum install firewalld systemd -y
    #开启防火墙
    service firewalld  start 
    #或者
    systemctl start firewalld
    

    3.2 SSH协议配置

    #安装SSH协议
    yum install -y curl policycoreutils-python openssh-server
    #设置SSH服务开机自启动
    systemctl enable sshd
    #启动SSH服务
    systemctl start sshd
    

    3.3 防火墙添加相关配置

    #添加HTTP服务到firewalld
    firewall-cmd --permanent --add-service=http
    #添加HTTPS服务到firewalld
    firewall-cmd --permanent --add-service=https
    #重启防火墙
    systemctl reload firewalld
    

    3.4 Postfix安装与配置

    #安装Postfix以发送通知邮件
    yum install postfix
    #将postfix服务设置成开机自启动
    systemctl enable postfix
    #启动postfix
    systemctl start postfix
    

    3.5 安装vim编辑器

    yum install vim -y
    

    四、GitLab安装

    4.1安装rpm包

    rpm -ivh gitlab-ce-13.8.4-ce.0.el7.x86_64.rpm
    
    image-20210214212916957

    4.2 修改配置文件

    #编辑配置文件
    vim  /etc/gitlab/gitlab.rb
    #修改访问URL
    #格式:external_url 'http://ip:端口'
    external_url 'http://192.168.61.72:80'
    #配置时区
    gitlab_rails['time_zone'] = 'Asia/Shanghai'
    

    4.3 开启防火墙端口

    #开放80端口
    firewall-cmd --zone=public --add-port=80/tcp --permanent   
    #重启防火墙
    firewall-cmd --reload
    #查看端口号是否开启
    firewall-cmd --query-port=80/tcp
    

    4.4 重置Gitlab

    gitlab-ctl reconfigure
    

    4.5 重启GitLab

    gitlab-ctl restart
    

    4.6 登录验证

    image-20210215172400842 image-20210215172552707

    以上,请参考!

  • 相关阅读:
    Linux菜鸟起飞之路【三】Linux常用命令
    Linux菜鸟起飞之路【二】Linux基本常识
    Linux菜鸟起飞之路【一】基本知识与Linux的安装
    交换机和路由器区别
    netdom join more ou
    keepalive.conf配置模板
    mysql7.7.22 Gtid主从搭建
    python 列表处理
    python openpyxl模块使用
    mysql5.7
  • 原文地址:https://www.cnblogs.com/shuangxinyuan/p/14410339.html
Copyright © 2011-2022 走看看