首页 > 其他 > 详细

1、安装gitlab

时间:2020-01-21 14:26:40      阅读:54      评论:0      收藏:0      [点我收藏+]

1、安装Gitlab

Gitlab分为社区版和企业版(收费),这里安装的是ce社区版本

方式一:

Gitlab官方有提供好的rpm包仓库,所以采用yum安装即可。

 

[root@localhost ~]# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash   #添加yum源

[root@localhost ~]# yum makecache  #更新yum缓存

[root@localhost ~]# yum install gitlab-ce #默认安装最新版;还可以yum install gitlab-ce-x.x.x指定版本来安装

方式二:

如果官方提供的源下载比较慢,可以采用国内镜像源如清华的(https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/)来安装


[root@localhost ~]# vim /etc/yum.repos.d/gitlab-ce.repo

[gitlab-ce]
name=Gitlab
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1

[root@localhost ~]# yum makecache

[root@localhost ~]# yum -y install gitlab-ce

 

 

gitlab主要目录:

/var/opt/gitlab/git-data/repositories/:库默认存储目录

/opt/gitlab/:应用代码和相应的依赖程序

/var/opt/gitlab/:gitlab-ctl reconfigure命令编译后的应用数据和配置文件,不需要人为修改配置

/etc/gitlab:配置文件目录

/var/log/gitlab:此目录下存放了gitlab各个组件产生的日志

/var/opt/gitlab/backups/:备份文件生成的目录

 

 

 

2、修改配置

 技术分享图片

 

 

安装后,按照提示修改配置文件中的url地址为本地服务器的地址:

[root@localhost ~]# vim /etc/gitlab/gitlab.rb

external_url ‘http://192.168.100.161‘

[root@localhost ~]# gitlab-ctl reconfigure  #重新加载配置

 

 

浏览器访问:

http://192.168.100.161

浏览器访问,第一次登录需要设置密码(不小于8位),登陆用户名为root

 

gitlab常用命令:

gitlab-ctl start    # 启动所有 gitlab 组件;

gitlab-ctl stop     # 停止所有 gitlab 组件;

gitlab-ctl restart  # 重启所有 gitlab 组件;

gitlab-ctl reconfigure    # 启动服务;

vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;

gitlab-rake gitlab:check SANITIZE=true --trace   # 检查gitlab;

gitlab-ctl status   # 查看服务状态;

gitlab-ctl tail nginx    # 查看日志;

1、安装gitlab

原文:https://www.cnblogs.com/chuangcc/p/12221572.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!