Devops实践-Gitlab安装(一)
系统要求
环境准备
开放ssh 和 http服务
sudo yum install -y curl policycoreutils-python openssh-server perl
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-
service=https
sudo systemctl reload firewalld
邮件服务准备
安装Postfix以发送通知电子邮件。如果想使用其他解决方案发送邮件,安装GitLab后再配置外部SMTP服务器
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
添加Gitlab仓库
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
下载gitlab-ce
gitlab-ce 社区版本 比 gitlab-ee 企业版本 (需要付费)
如果您只想下载开源软件,Community Edition是最佳选择。此发行版不包含专有代码。从功能上讲,它将具有与企业版中的免费层相同的功能。
yum install -y gitlab-ce
修改配置文件
vim /etc/gitlab/gitlab.rb
#配置地址(大约在第15行)
external_url 'http://gitlab.xxx.com' // 配置为DNS解析的域名
如果没有DNS可以绑定本地host来访问(测试环境)
启动服务
sudo gitlab-ctl start
访问服务
打开浏览器 访问http://gitlab.xxx.com
首次登陆需要你设置管理员的密码。
登陆
用户名:root 密码: xxx
可以正常使用gitlab了
参考
https://about.gitlab.com/install/ce-or-ee/?distro=centos-7 CE和EE选择
https://about.gitlab.com/install/#centos-7 Centos-7 安装