Gitlab Server 部署

1 Gitlab Server 部署

1、资源环境

主机名 IP地址 服务 系统版本
cicd-gitlab 192.168.152.148 gitlab-ce (13.1.3) CentOS7.6
1、修改主机名
[root@localhost ~]# hostnamectl --static set-hostname cicd-gitlab
2、关闭防火墙
[root@cicd-gitlab ~]#  systemctl stop iptables firewalld
[root@cicd-gitlab ~]#  systemctl disable iptables firewalld
3、开启邮件服务
[root@cicd-gitlab ~]# systemctl start postfix
[root@cicd-gitlab ~]# systemctl enable postfix
4、关闭 SELinux
[root@cicd-gitlab ~]#  sed -ri '/SELINUX=/cSELINUX=disabled' /etc/selinux/config
[root@cicd-gitlab ~]#  setenforce 0           # 临时关闭SELinux
[root@cicd-gitlab ~]#  reboot
5、添加 hosts
[root@cicd-gitlab ~]# vim /etc/hosts
192.168.152.150 gitlab.qfedu.com

2、部署 Gitlab

1、安装 Gitlab 依赖包
[root@cicd-gitlab ~]# yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python
# gitlab-ce 10.x.x以后的版本需要依赖policycoreutils-python
2、添加 Gitlab 安装源 (根据需求配置源)
1、添加阿里源
[root@cicd-gitlab ~]# vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
Repo_gpgcheck=0
Enabled=1
Gpgkey=https://packages.gitlab.com/gpg.key
2、 添加清华源
[root@cicd-gitlab ~]# vim gitlab-ce.repo
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1

[root@cicd-gitlab ~]# vim gitlab-ee.repo
[gitlab-ee]
name=Gitlab EE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ee/yum/el$releasever/
gpgcheck=0
enabled=1
3、添加官方源
1、手动添加
[root@cicd-gitlab ~]# vim runner_gitlab-ci-multi-runner.repo
[runner_gitlab-ci-multi-runner]
name=runner_gitlab-ci-multi-runner
baseurl=https://packages.gitlab.com/runner/gitlab-ci-multi-runner/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/runner/gitlab-ci-multi-runner/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[runner_gitlab-ci-multi-runner-source]
name=runner_gitlab-ci-multi-runner-source
baseurl=https://packages.gitlab.com/runner/gitlab-ci-multi-runner/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/runner/gitlab-ci-multi-runner/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
2、脚本添加
[root@cicd-gitlab ~]# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
4、手动下载安装包地址
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ee/yum/el7/
3、安装 Gitlab(根据需要选择 ce/ee)
[root@cicd-gitlab ~]# yum -y install gitlab-ce                    # 自动安装最新版
[root@cicd-gitlab ~]# yum -y install gitlab-ce-x.x.x				# 安装指定版本Gitlab

[root@cicd-gitlab ~]# yum -y install gitlab-ce 
warning: gitlab-ce-13.1.3-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing...     
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值