devops之路第一篇(gitlab搭建)

1. 準備基礎環境

操做系統:centos7.xpython

  • 設置yum國內源
  • 安裝 sshd
yum install -y curl policycoreutils-python openssh-server
  • 啓用並啓動 sshd
systemctl enable sshd
systemctl start sshd
  • 配置防火牆

設置配置git

echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf

啓用並啓動防火牆vim

systemctl enable firewalld
systemctl start firewalld

2.安裝 GitLab

配置下載源centos

$vi /etc/yum.repos.d/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

安裝gitlab-cessh

$yum install -y gitlab-ce

3.初始化 GitLab

  • 配置域名
$vim /etc/gitlab/gitlab.rb 
external_url 'http://work.myteam.com'
  • 初始化 GitLab
sudo gitlab-ctl reconfigure
相關文章
相關標籤/搜索