Linux运维-陈雷雷


持续集成教程05_gitlab私有仓库安装与配置

admin 2019-12-20 632浏览 1条评论
首页/正文
分享到: / / / /

1. gitlab介绍

官方网站: www.gitlab.com

gitlab是一款使用ruby编写的代码版本管理系统,他可以通过web界面来管理代码.

2. gitlab安装

官方安装文档: https://about.gitlab.com/install/ 建议: 在企业环境中,gitlab一定要尽可能使用一台独立的服务器进行管理.因为gitlab是用于存储代码的. 需要谨慎.

1. 安装gitlab
yum install -y curl policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd

2. 启用postfix(官方文档写的安装.此步可以跳过.)
yum install postfix -y
systemctl enable postfix
systemctl start postfix


3.防火墙规则(开启防火墙才配置,没开防火墙不用配置.)
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld

2.1 使用gitlab包来安装.

gitlab安装包: https://packages.gitlab.com/gitlab/gitlab-ce 清华安装源: https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/ [选择 yum版] 这里什么版本都有. 建议gitlab安装在一台独立服务器中.

#1. 依赖包安装
yum install curl policycoreutils openssh-server openssh-clients policycoreutils-python

#2. 下载gitlab包
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.6-ce.0.el7.x86_64.rpm
上传到服务器


#3. 安装gitlab
rpm -ivh gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm

[root@master tools]# rpm -ivh gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm
warning: gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:gitlab-ce-10.2.2-ce.0.el7        ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.
git安装完成.

#4. 配置文件:
ls /etc/gitlab/gitlab.rb
vim  /etc/gitlab/gitlab.rb
修改:
external_url 'http://gitlab.example.com' 

#网址改为 当前主机IP:
external_url 'http://10.0.0.63'

修改后必须执行重新配置: 
命令:
gitlab-ctl reconfigure

出现:
Running handlers complete
Chef Client finished, 382/541 resources updated in 01 minutes 52 seconds
gitlab Reconfigured!  ##代表配置成功了


#4. 启动gitlab:
[root@master tools]# gitlab-ctl status
run: gitaly: (pid 25917) 151s; run: log: (pid 25672) 178s
run: gitlab-monitor: (pid 25933) 150s; run: log: (pid 25775) 171s
run: gitlab-workhorse: (pid 25905) 151s; run: log: (pid 25571) 197s
run: logrotate: (pid 25609) 184s; run: log: (pid 25608) 184s
run: nginx: (pid 25591) 190s; run: log: (pid 25590) 190s
run: node-exporter: (pid 25720) 177s; run: log: (pid 25719) 177s
run: postgres-exporter: (pid 25962) 149s; run: log: (pid 25829) 163s
run: postgresql: (pid 25351) 241s; run: log: (pid 25350) 241s
run: prometheus: (pid 25948) 150s; run: log: (pid 25810) 164s
run: redis: (pid 25279) 247s; run: log: (pid 25278) 247s
run: redis-exporter: (pid 25790) 170s; run: log: (pid 25789) 170s
run: sidekiq: (pid 25554) 203s; run: log: (pid 25553) 203s
run: unicorn: (pid 25516) 205s; run: log: (pid 25515) 205s

#启动gitlab:
[root@master tools]# gitlab-ctl restart
ok: run: gitaly: (pid 26704) 0s
ok: run: gitlab-monitor: (pid 26715) 0s
ok: run: gitlab-workhorse: (pid 26724) 1s
ok: run: logrotate: (pid 26733) 0s
ok: run: nginx: (pid 26740) 1s
ok: run: node-exporter: (pid 26746) 0s
ok: run: postgres-exporter: (pid 26752) 1s
ok: run: postgresql: (pid 26761) 0s
ok: run: prometheus: (pid 26804) 0s
ok: run: redis: (pid 26813) 1s
ok: run: redis-exporter: (pid 26817) 0s
ok: run: sidekiq: (pid 26831) 0s
ok: run: unicorn: (pid 26840) 1s
#状态:
[root@master tools]# gitlab-ctl status
run: gitaly: (pid 26704) 43s; run: log: (pid 25672) 418s
run: gitlab-monitor: (pid 26715) 43s; run: log: (pid 25775) 411s
run: gitlab-workhorse: (pid 26724) 43s; run: log: (pid 25571) 437s
run: logrotate: (pid 26733) 42s; run: log: (pid 25608) 424s
run: nginx: (pid 26740) 42s; run: log: (pid 25590) 430s
run: node-exporter: (pid 26746) 41s; run: log: (pid 25719) 417s
run: postgres-exporter: (pid 26752) 41s; run: log: (pid 25829) 403s
run: postgresql: (pid 26761) 40s; run: log: (pid 25350) 481s
run: prometheus: (pid 26804) 40s; run: log: (pid 25810) 404s
run: redis: (pid 26813) 40s; run: log: (pid 25278) 487s
run: redis-exporter: (pid 26817) 39s; run: log: (pid 25789) 410s
run: sidekiq: (pid 26831) 37s; run: log: (pid 25553) 443s
run: unicorn: (pid 26855) 36s; run: log: (pid 25515) 445s


启动成功后,通过web浏览器进行访问:

启动gitlab访问结果:

启动后第一次进入gitlab会让你更改管理员密码[默认用户root]:

gitlab界面

相关软件包

gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm

05.gitlab_01.gitlab介绍与gitlab安装.pdf

最后修改:2019-12-20 19:14:35 © 著作权归作者所有
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付

上一篇

发表评论

评论列表

匿名用户 2020-09-27 13:52:52
online gambling <a href=" http://onlinecasinouse.com/# ">online casino </a> casino play http://onlinecasinouse.com/#
回复

博客信息

  • 文章数目 123
  • 标签数目 333
  • 运行天数
  • 最后活动

广告



文章目录