centos 7下 gitlab的安装与配置 自学笔记

实验环境 centos 7.7 6G 4核

centos 源:wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
EPEL 源: wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@localhost ~]# yum makecache
[root@localhost ~]# systemctl stop firewalld && systemc disable firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# cat /etc/selinux/config

SELINUX=disabled

  1. 安装依赖组件
    [root@localhost ~]# yum install curl policycoreutils openssh-server openssh-clients -y
    [root@localhost ~]# systemctl enable postfix
    [root@localhost ~]# systemctl start postfix
    [root@localhost yum.repos.d]# vim gitlab_gitlab-ce.repo
    [gitlab-ce]
    name=gitlab-ce
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
    repo_gpgcheck=0
    gpgcheck=0
    enabled=1
    gpgkey=https://packages.gitlab.com/gpg.key
    [root@localhost yum.repos.d]# yum install gitlab-ce -y
    安装有点慢
    在这里插入图片描述
    [root@localhost ~]# vim /etc/gitlab/gitlab.rb
    29# external_url ‘http://gitlab.example.com’
    29 external_url ‘http://10.60.11.110’
    617 gitlab_rails[‘smtp_enable’] = true
    618 gitlab_rails[‘smtp_address’] = “smtp.xxx@qq.com”
    619 gitlab_rails[‘smtp_port’] = 465
    620 gitlab_rails[‘smtp_user_name’] = “xxx@qq.com”
    621 gitlab_rails[‘smtp_password’] = “smtp授权码”
    622 gitlab_rails[‘smtp_domain’] = “qq.com”
    623 gitlab_rails[‘smtp_authentication’] = “login”
    624 gitlab_rails[‘smtp_enable_starttls_auto’] = true
    625 gitlab_rails[‘smtp_tls’] = true
    626 user[‘git_user_email’] = “xxx@qq.com”
    627 gitlab_rails[‘gitlab_email_from’] = ‘xxx@qq.com’

[root@localhost ~]# gitlab-ctl reconfigure
漫长的等待
[root@localhost ~]# gitlab-ctl status
在这里插入图片描述

浏览器访问http://10.60.11.110
在这里插入图片描述
设置root 密码 不少于8位
在这里插入图片描述
登录

在这里插入图片描述

管理 gitlab
关闭 gitlab: # gitlab-ctl stop
启劢 gitlab: # gitlab-ctl start
重启 gitlab: # gitlab-ctl restart
gitlab 主配置文件:/etc/gitlab/gitlab.rb //可以自定义一些邮件服务等
日志地址:/var/log/gitlab/ // 对应各服务
服务地址:/var/opt/gitlab/ // 对应各服务的主目录
仓库地址:/var/opt/gitlab/git-data //记录项目仓库等提交信息
重置配置:gitlab-ctl reconfigure //丌要乱用,会重置为最原始的配置的
重启服务:gitlab-ctl stop/start/restart //启劢命令

标题使用docker安装 gitlab

docker search gitlab
docker pull gitlab/gitlab-ce
docker pull twang2218/gitlab-ce-zh

docker run -d -h gitlab --name gitlab -p 443:443 -p 80:80 -p 22:22 --restart always -v /srv/gitlab/config:/etc/gitlab -v /srv/gitlab/logs:/var/log/gitlab -v /srv/gitlab/data:/var/opt/gitlab twang2218/gitlab-ce-zh:latest

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值