zoukankan      html  css  js  c++  java
  • linux_gitlab的安装及配置

    GitLab搭建及使用

    • GitLab简介
    GitLab 是利用Ruby on Rails开发的一个开源版本管理系统,实现了一个自托管的Git项目仓库,是集代码托管,测试,部署于一体的开源Git仓库管理软件,可通过web界面进行访问公开或私人项目,与GitHub类似,GitLab能够浏览代码,管理缺陷和注释,可以管理团队对仓库的访问;
    
    • Git家族成员
    1、git: 是一种版本控制系统,是一个命令和工具
    2、gitlib: 是用于实现git功能的开发库
    3、github: 是一个基于git实现的在线代码托管仓库,公开项目是免费的,可以付费创建私人项目
    4、gitlab:是一个基于git实现的在线代码仓库托管软件,可以用gitlab搭建一套类似github的系统
    注意:
    GitLab对硬件还是有一定要求的,1核心的CPU基本上可以满足需求,大概支撑100个左右的用户,不过在运行GitLab网站的同时还需要运行多个后台job,就会显得有点捉襟见肘了。需要至少4GB的可寻址内存(RAM交换)来安装和使用GitLab,操作系统和任何其他正在运行的应用程序也将使用内存,因此请记住,在运行GitLab之前,您至少需要4GB的可用空间。如果使用更少的内存,GitLab将在重新配置运行期间给出奇怪的错误;
    
    • yum源准备
    下载最新的yum源和epel源
    1、yum源:
    $ wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    2、epel源:
    $ wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    3、清除缓存
    $ yum clean all
    4、创建数据源
    $ yum makecache
    
    • GitLab的安装(Centos系统)
    1、安装gitlab的依赖包
    $ yum -y install policycoreutils-python openssh-server lsof net-tools postfix wget vim
    2、设置ssh服务开机自启并启动ssh服务
    $ systemctl enable sshd
    $ systemctl start sshd
    3、设置postfix开机自启并启动
    $ systemctl enable postfix
    $ systemctl start postfix
    4、添加gitlab镜像源并安装
    $ wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
    $ rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
    5、防止端口冲突,修改端口
    $ vim /etc/gitlab/gitlab.rb
    # external_url 'http://服务器IP:端口'   如:http://192.168.2.200:8070
    # 预配置+启动:gitlab-ctl reconfigure && gitlab-ctl restart
    注意:在修改external_url之后还是不能访问,修改如下:
    vim /etc/gitlab/gitlab.rb
    # 848行:nginx['listen_port'] = 8070
    # 581行:unicorn['port'] = 8090
    $ vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
    # 39行:listen *:8070
    6、配置并启动gitlab
    $ gitlab-ctl reconfigure
    $ gitlab-ctl restart
    7、firewalld开放8070端口,pemmanent表示永久生效并重新加载配置
    $ firewall-cmd --permanent --zone=public --add-port=8070/tcp
    $ firewall-cmd --reload
    注意:提示 "ok:run:" 表示成功!!!
    8、浏览器访问:
    $ 192.168.2.200:8070
    
    • GitLab使用命令
    1、gitlab-ctl help  # 命令帮助
    2、gitlab-ctl reconfigure # 重新配置
    3、gitlab-ctl show-config # 显示配置
    4、gitlab-ctl uninstall # 卸载
    5、gitlab-ctl kill # 杀服务
    6、gitlab-ctl restart # 重启服务
    7、gitlab-ctl service-list # 服务清单
    8、gitlab-ctl start # 启动服务
    9、gitlab-ctl status # 查看状态
    10、gitlab-ctl stop # 停止服务
    11、gitlab-ctl tail # 查看所有启动服务的服务日志
    
  • 相关阅读:
    vmware ubuntu 异常关机无法连接到网络
    Speed up GCC link
    常用的一些解压命令
    Log4j 漏洞复现
    Test Case Design method Boundary value analysis and Equivalence partitioning
    CCA (Citrix Certified Administrator) exam of “Implementing Citrix XenDesktop 4”
    What is Key Word driven Testing?
    SAP AGS面试小结
    腾讯2013终端实习生一面
    指针的引用
  • 原文地址:https://www.cnblogs.com/Anesthesia-is/p/12772806.html
Copyright © 2011-2022 走看看