gitlab 安装

centos7下安装gitlab

1、首先按官网提示先安装依赖,然后执行下面命令添加yum源,选择gitlab-ce社区版
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

2、更新本地yum缓存
sudo yum makecache

3、安装gitlab-ce
sudo yum install -y gitlab-ce

以上,即可安装完成。

sudo gitlab-ctl start # 启动所有 gitlab 组件;
sudo gitlab-ctl stop # 停止所有 gitlab 组件;
sudo gitlab-ctl restart # 重启所有 gitlab 组件;
sudo gitlab-ctl status # 查看服务状态;
sudo gitlab-ctl reconfigure # 启动服务;
sudo vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
sudo gitlab-ctl tail # 查看日志
 
 
 
 

gitlab 卸载

1、停止gitlab

gitlab-ctl stop


2、卸载gitlab(注意这里写的是gitlab-ce)

rpm -e gitlab-ce

3、查看gitlab进程

ps aux | grep gitlab

4、杀掉第一个进程(就是带有好多.............的进程)

kill -9 18777

gitlab 安装


杀掉后,在ps aux | grep gitlab确认一遍,还有没有gitlab的进程

5、删除所有包含gitlab文件

find / -name gitlab | xargs rm -rf
 
 
 
gitlab安装指定版本:

一、添加镜像地址

添加镜像地址的目的是为了提高国内用户软件下载的速度,编辑(新建)文件gitlab-ce.repo,指令:

vi /etc/yum.repos.d/gitlab-ce.repo

输入:

[gitlab-ce]
name=gitlab-ce
# 清华大学的镜像源
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

保存修改:按下ESC键,再输入:wq,然后回车

二、GitLab12.0.9下载:

curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.0.9-ce.0.el7.x86_64.rpm

三、GitLab12.0.9安装:

rpm -i gitlab-ce-12.0.9-ce.0.el7.x86_64.rpm
 
四、修改gitlab 访问ip
vim /etc/gitlab/gitlab.rb
/external_url
 
external_url 'http://47.110.230.147'
保存修改
 
四.启动服务
gitlab-ctl reconfigure
 
五、启动并访问

gitlab-ctl restart

 

1、首先按官网提示先安装依赖,然后执行下面命令添加yum源,选择gitlab-ce社区版
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

2、更新本地yum缓存
sudo yum makecache

3、安装gitlab-ce
sudo yum install -y gitlab-ce

以上,即可安装完成。