GitLab安装及使用
GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。
GitLab拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。
1. GitLab安装与配置
1.1. 基础环境准备
[root@mini04 ~]# yum install -y curl policycoreutils openssh-server openssh-clients postfix
………………
[root@mini04 ~]# systemctl start postfix
1.2. 配置yum源
注:由于网络问题,国内用户,建议使用清华大学的镜像源进行安装:
[root@mini04 ~]# vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=gitlab-ce
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
repo_gpgcheck=
gpgcheck=
enabled=
gpgkey=https://packages.gitlab.com/gpg.key
1.3. 更新本地yum缓存
[root@mini04 ~]# yum makecache
………………
1.4. 安装GitLab
[root@mini04 ~]# yum install -y gitlab-ce
………………
1.5. 配置修改
[root@mini04 ~]# vim /etc/gitlab/gitlab.rb
………………
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
# external_url 'http://gitlab.example.com'
# 能够解析
external_url 'http://mini04'
1.6. 配置并启动gitlab-ce
[root@mini04 ~]# gitlab-ctl reconfigure
………………
1.7. 查看gitlab状态
[root@mini04 ~]# gitlab-ctl status
run: alertmanager: (pid ) 27s; run: log: (pid ) 25s
run: gitaly: (pid ) 28s; run: log: (pid ) 28s
run: gitlab-monitor: (pid ) 28s; run: log: (pid ) 27s
run: gitlab-workhorse: (pid ) 28s; run: log: (pid ) 27s
run: logrotate: (pid ) 90s; run: log: (pid ) 27s
run: nginx: (pid ) 96s; run: log: (pid ) 27s
run: node-exporter: (pid ) 78s; run: log: (pid ) 28s
run: postgres-exporter: (pid ) 26s; run: log: (pid ) 25s
run: postgresql: (pid ) 140s; run: log: (pid ) 29s
run: prometheus: (pid ) 27s; run: log: (pid ) 27s
run: redis: (pid ) 146s; run: log: (pid ) 28s
run: redis-exporter: (pid ) 66s; run: log: (pid ) 27s
run: sidekiq: (pid ) 103s; run: log: (pid ) 29s
run: unicorn: (pid ) 110s; run: log: (pid ) 30s
1.8. GitLab常用命令
gitlab-ctl start # 启动所有 gitlab 组件;
gitlab-ctl stop # 停止所有 gitlab 组件;
gitlab-ctl restart # 重启所有 gitlab 组件;
gitlab-ctl status # 查看服务状态;
gitlab-ctl reconfigure # 启动服务;
vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;
gitlab-ctl tail # 查看日志;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
2. GitLab使用
2.1. 首次登陆
http://10.0.0.14

首次登陆会要求修改root用户的密码。

之后对到登陆页面,使用root用户登录即可。
2.2. 添加SSH Key信息
[root@mini04 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ACvHut11cMKDaL1QzsrL3x23OyUl9cd7+kLfFW30cLM root@mini04
The key's randomart image is:
+---[RSA ]----+
| . . |
| . O o o.o|
| . B * = . . *=|
| * o o = . .EB|
| . o . S . o .+|
| + o . . . o.o|
| . + . . .+ o+|
| . . . o..o o|
| . . . oo o.|
+----[SHA256]-----+
[root@mini04 ~]# ll -d .ssh/
drwx------ root root Sep : .ssh/
[root@mini04 ~]# cd .ssh/
[root@mini04 .ssh]# ll
total
-rw------- root root Sep : id_rsa
-rw-r--r-- root root Sep : id_rsa.pub
[root@mini04 .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpqkXHf8f7UQSPVH0E40pydotJChFQliRSSmHQezVGh91AB++YfUeGPHHDWDgLCjefxCc+KnJrqJPrUR02K1OwJoC9X4K2x0+gJekEpfs9Yb7Y5hE5XiGz4Z6X+ybN015u3G9czVhV5XAT2M4q+couVgaPpf2npfqv9eqhTuh1W0336sKIvAj1N8iXzfSDbdaERCP2NscnTOrgmHZ8aVMvyyruslvQoNjgQN06/91R48aSqwD++kLOTChGo7qNC10H315UR7cX2MKME9ssuyf77azFLYYdBrALR//YjOoid/jkTHkCLO1ZvHdqakWK7YAHOwV/RocTcm71hqq3mLfz root@mini04



GitLab的页面使用,请自行百度参考。git的命令行使用,可参考前面的几篇博文。
GitLab安装及使用的更多相关文章
- GitLab安装说明
GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. gitlab是基于Ruby on Rails的, ...
- Gitlab安装、汉化及使用
环境:centos 关闭防火墙和selinux [root@Gitlab ~]# setenforce [root@Gitlab ~]# service iptables stop && ...
- git\CentOS6.5中gitlab安装教程
一.Git 起源: Git是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本 ...
- Ubuntu gitlab安装文档及邮件通知提醒配置
1.安装依赖包,运行命令 sudo apt-get install curl openssh-server ca-certificates postfix 2.由于gitlab官方源可能被“墙”,首先 ...
- gitlab安装随记
gitlab安装 配置yum源 sudo vim /etc/yum.repos.d/gitlab-ce.repo 按照网上别人的例子,修改为清华的源 [gitlab-ce] name=Gitlab C ...
- CentOS 7 环境下GitLab安装及基本配置
新实验室要求重新建设GitLab,对于我来讲,是第一次有机会当元老参与实验室的建设.下面分享我自己的实测经验: 1. 安装依赖软件并设置开机启动 yum install curlpolicycoreu ...
- gitlab之一: gitlab安装配置使用
参考: gitlab 安装和配置 gitlab下载地址: https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/ 官方教程: https://about.gitl ...
- Gitlab安装以及汉化
Gitlab安装以及汉化 系统环境: CentOS 7.5 IP:192.168.1.2 关闭selinux.firewalld gitlab-ce-10.8.4 rpm包:下载地址 一.下载并安装g ...
- GITLAB安装笔记
CentOS 7 最小安装后操作 设置时区timedatectl set-timezone Asia/Shanghai 添加 Gitlab 清华源 vi /etc/yum.repos.d/gitlab ...
随机推荐
- Perl流程控制语句
布尔值判断 如果是数字,0表示假,其它所有数字都是真. 如果是字符串,空字符串('')为假,其它所有字符串为真(有例外,见下一条). 如果是字符串'0',perl是当作数值0来处理的,所以这是唯一的非 ...
- Python图像处理之验证码识别
在上一篇博客Python图像处理之图片文字识别(OCR)中我们介绍了在Python中如何利用Tesseract软件来识别图片中的英文与中文,本文将具体介绍如何在Python中利用Tesseract ...
- CloudFoundry 之 IBMCloud 项目部署java例子
步骤一 通过官网注册IBMCloud账号 https://idaas.iam.ibm.com/idaas/mtfim/sps/authsvc?PolicyId=urn:ibm:security:aut ...
- IIS Tomcat共享80端口
为什么有这种需求, 原因是这样的, 公司有一个Java的web项目,在另一台服务器A上,最近老板一时兴起,想把他合并到这台稳定点的服务器B上,服务器B上使用IIS来寄宿asp.net 网站, 怎么办呢 ...
- c# 创建,加载,修改XML文档
using System.Xml.Linq; static void Main(string[] args) { XDocument xDocument = new XDocument(new XEl ...
- [Linux] Nginx响应压缩gzip
压缩和解压缩 .本节介绍如何配置响应的压缩或解压缩以及发送压缩文件. gzip on; .NGINX仅使用MIME类型text / html压缩响应 gzip_types text/plain app ...
- spring_06装配bean_2
一.前言 1.自动装配尽量不要用,不如使用set明确 二. 通过构造函数注入值(Bean中可以没有get,set方法) <bean id="emp" class=" ...
- FastJson序列化Json自定义返回字段,普通类从spring容器中获取bean
前言: 数据库的字段比如:price:1 ,返回需要price:1元. 这时两种途径修改: ① 比如sql中修改或者是在实体类转json前遍历修改. ②返回json,序列化时候修改.用到的是fastj ...
- MyBatis:GeneratorConfig生成mapper以及pojo
首先我们需要导入相应的依赖 之后需要针对的配置一些数据 接着我们需要针对性的写配置文件,在根目录下写mybatis的主要配置文件 如上图我们配置了数据库连接.对应的一些pojo.mapper.java ...
- Elasticsearch系列(1):认识Elasticsearch
官方定义 Elasticsearch 是一个实时的分布式搜索分析引擎, 它能让你以一个之前从未有过的速度和规模,去探索你的数据. 它被用作全文检索.结构化搜索.分析以及这三个功能的组合. Elasti ...