首页 技术 正文
技术 2022年11月20日
0 收藏 857 点赞 2,473 浏览 1972 个字

DevOps元素周期表——1号元素 Gitlab

GitLab 是由 GitLab Inc.开发,一款基于 Git 的完全集成的软件开发平台(fully integrated software development platform)。另外,GitLab 且具有wiki以及在线编辑、issue跟踪功能、CI/CD 等功能。

一. 简介

官网: https://about.gitlab.com/

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

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

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

二. 安装配置

  • 系统

    Centos7

  • 准备工作

    • 关闭firewalld防火墙

      • systemctl stop firewalld
      • systemctl disable firewalld
    • 关闭SELINUX并重启系统

      • vi /etc/sysconfig/selinux

        SELINUX=disabled

      • reboot

  • 开始安装

    安装Omnibus Gitlab-ce package

    # yum -y install curl policycoreutils openssh-server openssh-clients postfix

    配置YUM仓库

    # curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

    启动postfix邮件服务

    # systemctl start postfix && systemctl enable postfix

    安装Gitlab-ce社区版本

    # yum install -y gitlab-ce

    证书创建与配置加载

    Nginx SSL代理服务配置

    初始化Gitlab相关服务并完成安装

    # mkdir -p /etc/gitlab/ssl# openssl genrsa -out "/etc/gitlab/ssl/gitlab.example.com.key" 2048
    # openssl req -new -key "/etc/gitlab/ssl/gitlab.example.com.key" -out "/etc/gitlab/ssl/gitlab.example.com.csr"
# openssl x509 -req -days 365 -in "/etc/gitlab/ssl/gitlab.example.com.csr" -signkey "/etc/gitlab/ssl/gitlab.example.com.key" -out "/etc/gitlab/ssl/gitlab.example.com.crt"
# chmod 600 *
# vi /etc/gitlab/gitlab.rb将eternal_url 'http://gitlab.example.com' 改为httpsnginx['redirect_http_to_https'] = false 删除注释,改为truenginx['ssl_certificate'] = "etc/gitlab/ssl/#{node...}.crt" 改为 "/etc/gitlab/ssl/gitlab.example.com.cre"nginx['ssl_certificate_key'] = "etc/gitlab/ssl/#{node...}.key" 改为 "/etc/gitlab/ssl/gitlab.example.com.key"nginx['ssl_dhparam'] = "/etc/gitlab/ssl/dhparams.pem"
# gitlab-ctl reconfigure
# vi /var/opt/gitlab/nginx/conf/gitlab-http.confserver_name下面添加rewrite ^(.*)$ https://$host$1 permanent# gitlab-ctl restart

修改本地hosts文件

vmware-ip(虚拟机ip地址)gitlab.example.com

浏览器访问,登录修改admin账号密码

当然还可以通过docker来安装,不过对于gitlab这种服务,并不推荐使用docker,因为其服务依赖系统资源强,而且你的仓库也不希望一个简单的docker rm命令就可以被连带销毁掉。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,985
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,501
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,345
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,128
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,763
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,840