码迷,mamicode.com
首页 > 其他好文 > 详细

Gitlab安装

时间:2019-01-17 10:51:44      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:.repo   版本   note   server   守护进程   install   ash   mbed   ==   

 1.1 安装GitLab CE

1.1.1 创建或编辑 /etc/yum.repos.d/gitlab-ce.repo ,填入以下内容:

[root@gitlab ~]# vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

注:由于网络问题,国内用户,建议使用清华大学的镜像源进行安装:

1.1.2 安装

[root@gitlab ~]# yum makecache
[root@gitlab ~]# yum install gitlab-ce #可以指定版本安装如gitlab-ce-10.8.7,不指定则是最新版

1.1.3 配置并启动gitlab-ce

[root@gitlab ~]# gitlab-ctl reconfigure
[root@gitlab ~]# gitlab-ctl status   #查看状态

1.1.4 登录gitlab

gitlab默认端口是80端口,访问方式:http://IP

第一次登录gitlab,需要为root用户修改密码,root用户也是gitlab的超级管理员

技术分享图片

1.2 卸载gitlab

1.2.1 停止gitlab

$ gitlab-ctl stop  

1.2.2 卸载gitlab

$ yum remove gitlab-ce

1.2.3 杀进程

$ ps –ef|grep gitlab
#杀掉第一个守护进程(runsvdir -P /opt/gitlab/service log)

1.2.4 删除gitlab文件

$ find / -name *gitlab*|xargs rm -rf      删除所有包含gitlab的文件及目录
$ find / -name gitlab |xargs rm -rf         删除备份的配置文件

1.3 更改gitlab cloneexternal_url

在安装gitlab,新建项目之后,默认的clone链接为git@gitlab.example:test/test.githttp也是gitlab.example这种 这样每次clone时候都需要手动改下,改成ip或者域名才可以,可以按照如下方式更改external_url

更改/opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml文件(centos7) hostport即可 

vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
# 1. GitLab app settings
# ==========================

## GitLab settings
gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: 10.119.116.160
    port: 8181
    https: false

注意:更改后cloneexternal_url后执行gitlab-ctl restart,重新进入gitlab就生效了

1.4 gitlab仓库存储位置的修改方

1.4.1 创建数据目录

$ mkdir -p /data/gitlab

1.4.2 修改gitlab配置文件

vim /etc/gitlab/gitlab.rb
在git_data_dir下面添加一句git_data_dir "/data/gitlab"

技术分享图片

1.4.3 停止当前gitlab,重新加载配置

$ gitlab-ctl stop
$ gitlab-ctl reconfigure
$ gitlab-ctl start

 

Gitlab安装

标签:.repo   版本   note   server   守护进程   install   ash   mbed   ==   

原文地址:https://www.cnblogs.com/blsnt/p/10280857.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!