gitlab 汉化安装教程新手求教如何自己手动汉化

GitLab 社区版安装与汉化方法
1、GitLab 安装1.1 安装并配置必要的依赖关系在 CentOS 系统上,下面的命令将会打开系统防火墙 HTTP 和 SSH 的访问。yum install -y curl policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd
firewall-cmd --permanent --add-service=http
systemctl reload firewalld使用 Postfix 发送邮件yum install postfix
systemctl enable postfix
systemctl start postfix1.2 添加 GitLab 镜像源并安装添加镜像源,或手动curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash安装yum install -y gitlab-ce如果为下载的rpm包,使用如下命令安装rpm -i gitlab-ce-XXX.rpm1.3 修改地址vim /etc/gitlab/gitlab.rb将external_url改为对应的地址和端口1.4 配置并启动 GitLabgitlab-ctl reconfigure1.5 通过浏览器访问上一步配置的域名系统默认的管理员账号为 root, 第一次访问 GitLab,系统会重定向 url 到重置密码的页面,需要输入初始化管理员账号的密码。 设置完成后,系统会重定向到登录界面,你就可以使用刚才输入的密码登录系统了。2、GitLab 汉化2.1 确认当前版本cat /opt/gitlab/embedded/service/gitlab-rails/VERSION假设当前版本为 v10.1.1,并确认汉化版本库是否包含该版本的汉化标签(-zh结尾),也就是是否包含v10.1.1-zh。2.2 在本地 clone 仓库git clone https://gitlab.com/xhang/gitlab.git
2.3 比较汉化标签和原标签,导出 patch 用的 diff 文件cd gitlab
git diff v10.1.1 v10.1.1-zh & ../v10.1.1-zh.diff2.4 上传v10.1.1-zh.diff 文件到服务器gitlab-ctl stop
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 & v10.1.1-zh.diff2.5 确定没有 .rej 文件,重启 GitLab 即可gitlab-ctl start2.6 执行重新配置命令gitlab-ctl reconfigure原文连接: 参考链接:
没有更多推荐了,快速安装 GitLab 并汉化 - 简书
快速安装 GitLab 并汉化
源码安装 GitLab 步骤繁琐:需要安装依赖包,Mysql,Redis,Postfix,Ruby,Nginx……安装完毕还得一个个手动配置这些软件。源码安装容易出错,不顺利的话,一天都搞不定。源码最大的好处是私人定制,如果不做定制化,还是使用官方推荐的 omnibus packages 方式安装,网络好的话,一个小时内搞定。
参照,分别在 Ubuntu 14 和 CentOS 6 两个机器上安装,过程非常顺利,没有错误。
在 Ubuntu 14 安装
使用国内安装源镜像,加快安装速度。修改/etc/apt/sources.list.d/gitlab-ce.list,添加以下行
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian jessie main
开始安装:
# 安装依赖包
sudo apt-get install curl openssh-server ca-certificates postfix
# 安装 GitLab 社区版
apt-get install gitlab-ce
# 初始化,初始化完自动启动 GitLab
sudo gitlab-ctl reconfigure
在 CentOS 6 安装
使用国内镜像安装,新建 /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
gpgkey=https://packages.gitlab.com/gpg.key
安装步骤:
# 安装依赖包
sudo yum install curl openssh-server openssh-clients postfix cronie
# 启动 postfix 邮件服务
sudo service postfix start
# 检查 postfix
sudo chkconfig postfix on
# 安装 GitLab 社区版
sudo yum install gitlab-ce
# 初始化 GitLab
sudo gitlab-ctl reconfigure
添加访问的 host,修改/etc/gitlab/gitlab.rb的external_url
external_url 'http://git.home.com'
vi /etc/hosts,添加 host 映射
127.0.0.1 git.home.com
每次修改/etc/gitlab/gitlab.rb,都要运行以下命令,让配置生效
sudo gitlab-ctl reconfigure
配置本机的 host,如:192.168.113.59 git.home.com。最后,在浏览器打开网址http://git.home.com,登陆。默认管理员:
用户名: root
密码: 5iveL!fe
安装中文语言包(汉化)
以下汉化步骤参考,首先确认当前安装版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
当前安装版本是8.5.7,因此中文补丁需要打8.5版本。
克隆 GitLab 源码仓库:
# 克隆 GitLab.com 仓库
git clone https://gitlab.com/larryli/gitlab.git
#或 Gitcafe.com 镜像,速度更快
git clone https://gitcafe.com/larryli/gitlab.git
运行汉化补丁:
# 8.5 版本的汉化补丁(8-5-stable是英文稳定版,8-5-zh是中文版,两个 diff 结果便是汉化补丁)
sudo git diff origin/8-5-stable..8-5-zh & /tmp/8.5.diff
# 停止 gitlab
sudo gitlab-ctl stop
# 应用汉化补丁
cd /opt/gitlab/embedded/service/gitlab-rails
git apply /tmp/8.5.diff
# 启动gitlab
sudo gitlab-ctl start
至此,汉化完毕。打开地址http://git.home.com,便会看到中文版的GitLab。如下
安装完成。
如果是生产环境,备份是必须的。需要备份的文件:配置文件和数据文件。
备份配置文件
配置文件含密码等敏感信息,不要和数据备份文件放在一起。
sh -c 'umask 0077; tar -cf $(date "+etc-gitlab-%s.tar") -C /etc/gitlab'
备份数据文件
默认数据备份目录是/var/opt/gitlab/backups,手动创建备份文件:
# Omnibus 方式安装使用以下命令备份
sudo gitlab-rake gitlab:backup:create
日常备份,添加 crontab,运行crontab -e
# 每天2点执行备份
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
如要修改备份周期和目录,在/etc/gitlab/gitlab.rb中修改以下两个选项
# 设置备份周期为7天 - 604800秒
gitlab_rails['backup_keep_time'] = 604800
# 备份目录
gitlab_rails['backup_path'] = '/mnt/backups'
恢复之前,确保备份文件所安装 GitLab 和当前要恢复的 GitLab 版本一致。首先,恢复配置文件:
sudo mv /etc/gitlab /etc/gitlab.$(date +%s)
# 将下面配置备份文件的时间戳改为你所备份的文件的时间戳
sudo tar -xf etc-gitlab-.tar -C /
恢复数据文件
# 将数据备份文件拷贝至备份目录
sudo cp _gitlab_backup.tar /var/opt/gitlab/backups/
# 停止连接数据库的进程
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# 恢复这个备份文件,将覆盖GitLab数据库!
sudo gitlab-rake gitlab:backup:restore BACKUP=
# 启动 GitLab
sudo gitlab-ctl start
# 检查 GitLab
sudo gitlab-rake gitlab:check SANITIZE=true
持续集成(GitLab-CI)
GitLab 从 8.0 之后就集成了GitLab-CI,所以不需要再另外安装 CI。但需要安装Runner
1.添加 Runner 安装源
# For Debian/Ubuntu
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
# For CentOS
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash
安装gitlab-ci-multi-runner
# For Debian/Ubuntu
apt-get install gitlab-ci-multi-runner
# For CentOS
yum install gitlab-ci-multi-runner
2.注册 Runner。获取Token:以管理员身份登录GitLab,进入管理区域,点击侧边栏的Runner,如下图,“注册授权码”后的字符串便是Token。
sudo gitlab-ci-multi-runner register
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/ci):
http://git.home.com/ci
Please enter the gitlab-ci token for this runner:
# 输入Token
Please enter the gitlab-ci description for this runner:
[xxy-web-test-02]: test-runner
# 输入runner的名称
Please enter the gitlab-ci tags for this runner (comma separated):
# 输入runner的标签,以区分不同的runner,标签间逗号分隔
Registering runner... succeeded
runner=YDPz2or3
Please enter the executor: ssh, shell, parallels, docker, docker-ssh, virtualbox:
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
注册完成便可在上图中查看你所注册的Runner。至此,所有安装完毕,Runner的构建,后续补充。
Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智能路由,微代理,控制总线)。分布式系统的协调导致了样板模式, 使用Spring Cloud开发人员可以快速地支持实现这些模式的服务和应用程序。他们将在任何分布式...
选择将用来搭建 GitLab CE 的操作系统: CentOS 7 (and RedHat/Oracle/Scientific Linux 7) 检查您的服务器是否符合硬件需求.GitLab packages 是专为64位系统编译的. 如需安装到32位操作系统,可考虑其他的...
一、持续集成(Continuous Integration) 要了解GitLab-CI与GitLab Runner,我们得先了解持续集成是什么。 持续集成是一种软件开发实践,即团队开发成员经常集成他们的工作,通常每个成员每天至少集成一次,也就意味着每天可能会发生多次集成。每...
小序 由于单位的大部分应用是有外包开发,而且不同的外包公司的开发水平良莠不齐,代码风格也是惨不忍睹,所以导致代码后期的维护,二次开发成本很高。所以我特意在今年的TP中加入了代码管理,得到前辈的支持,在此记录一下。不加特殊说明,所用的都是在GitLab9.5.2社区版(hos...
操作系统:redhat6.8 gitlab版本:8.7 要求:要做gitlab迁移,公司指定系统,指定版本,绕了不少弯路,先做总结如下: 1.使用配置yum源的方式安装gitlab 如果下载rpm包,安装后redhat系统会提示有2个系统文件需要升级很麻烦。所以建议yum安...
SKT VS ROX Terges,一场王与王的对决。 绝对想不到这是一场半决赛,简直就像是决赛一般的刺激!他们之间的战斗,绝对没有妥协与放弃! 什么?你是强者?呵!那又怎样! 今天是一场打满五场的比赛,而且每一个观众也绝对期待着能够看见五场比赛。每一场比赛都展现出来竞技的...
1 过了立夏没多久,天气连续放晴,气温随之上升的飞快,夏天的味道越来越浓,让人忍不住脱去长衣,换上清清爽爽的短袖。 下午6点多,天还亮着,正是孩子们吃完晚饭出来撒欢的时间。 李大妈通常都会在这个时候出现,家常理短的逮谁都说个没完。 小豆子跟几个大孩子玩的正开心,李大妈看豆子...
****我说,我们应该有终其一生要守护的东西,比如花果山的晚霞,漫山遍野的花儿。**** 7月23日
多云 晚上和很久不见的大学室友看了《绣春刀2》,我以为我这样的状态一整天可以不说一句话,在见到她后,没想到我没有躺尸。 有那么一瞬间我觉得自己可能是...
一直喜欢看漫画。(看到漫画中的美男还忍不住yy一下了(?ω?)hiahiahia ) 有时候看到不喜欢的漫画,心里也会暗暗指责作者,太不良心了,这么潦草&(`^?)& 。。。 看到绘画交流平台上看到大神手机指绘的电子图,惊到我了。(原来没有好的工具也可以这么棒,一直以为需要...
重走长征路,暖冬万里行,笨笨豆在路上,为爱而行……河南信阳罗山县 25军长征出发地……《黎明清镜 》--& 路漫漫其修远兮,吾将上下而求索! 个人站点: www.itdevops.me...
Gitlab安装使用及汉化配置
一、GitLab简介
GitHub是2008年由Ruby on Rails编写而成,与业界闻名的Github类似;但要将代码上传到GitHub上面,而且将项目设为私有还要收费。GitLab 是一个用于仓库管理系统的开源项目,使用作为代码管理工具,可通过Web界面进行访问公开的或者私人项目,非常适合在团队内部使用。
在gitlab中有三个版本,分别是CE(社区版)、EE(企业版)、OM(RPM包完整版,里面包括nginx、redis等其它软件,比较大)。这里的编译安装版,是指CE版的源码安装
官网https://docs.gitlab.com/
这里呢建议大家使用rpm安装
1.1 Gitlab提供的功能
代码托管服务
访问权限控制
问题跟踪,bug的记录和讨论
代码审查,可以查看、评论代码
社区版基于 MIT License开源完全免费
1.2 Gitlab(Github)和Git区别
Github和Git是两回事。
Git是版本控制系统,Github是在线的基于Git的代码托管服务。
1.3 Github PK Sourceforge
为什么现在Github这么火,以至于世界顶级公司和项目的源码很多都托管在Github上
2011年,Github已经取代Sourceforge,成为最活跃的代码交流社区。这意味着在Open SourceCommunity(开源社区),Git取代了SVN已经成为事实。
1.3.1 Github界面
1.3.2 Sourceforge界面
1.4 搭建私有Git服务的优势
公司的项目,因为商业层面的原因,需要把代码托管到自有的服务器上,并且服务器很有可能是放在企业内网中,不对公网开放。
出于安全性的考虑,暂时没有使用国内的Git服务平台的计划。
GitHub和BitBucket,GitLab,由于服务商是在国外,受地域的影响,因此在网络访问上会有延迟。
现有的服务商,对于免费的套餐都有一定的限制,比如GitHub只允许建立免费的开源repository,不允许建立私有的仓库。BitBucket允许建立无限制的私有项目,不过对于项目中参与的开发人员是有人数限制的。当团队中开发者规模达到一定数量后,需要付费购买相应的套餐。
二、Gitlab安装
2.1 环境配置
redhat-7.x系列_x86_64
Mem建议至少2G
gitlab-ce.x86_64 0:8.8.0-ce
git-2.11.0
ruby2.1(至少是2.1)
192.168.201.148
192.168.201.130(作为测试端)
本次采用Omnibus 安装方式
2.2 gitlab环境要求
Red Hat Enterprise Linux (please use the CentOSpackages and instructions)
Scientific Linux (please use the CentOSpackages and instructions)
Oracle Linux (please use the CentOS packagesand instructions)
#Ruby versions
GitLab需要Ruby(MRI)2.3。支持低于2.3(2.1,2.2)的Ruby版本将停止与GitLab 8.13
必要的硬盘驱动器空间很大程度上取决于您要存储在GitLab中的存档的大小,但是根据经验,您应该至少拥有与所有存档组合相同的可用空间。
如果你希望在将来考虑使用LVM来安装硬盘驱动器空间方面具有灵活性,那么您可以在需要时添加更多的硬盘驱动器。
除本地硬盘驱动器外,你还可以安装支持网络文件系统(NFS)协议的卷。此卷可能位于文件服务器,网络连接存储(NAS)设备,存储区域网络(SAN)或Amazon Web Services(AWS)弹性块存储(EBS)卷上。
如果你有足够的RAM内存和最近的CPU,则GitLab的速度主要受硬盘搜索时间的限制。快速驱动(7200 RPM或更高)或固态硬盘(SSD)将提高GitLab的响应速度
1核心的CPU,基本上可以满足需求,大概支撑100个左右的用户,不过在运行GitLab网站的同时,还需要运行多个worker以及后台job,显得有点捉襟见肘了。
两核心的CPU是推荐的配置,大概能支撑500个用户.
4核心的CPU能支撑 2,000 个用户.
8核心的CPU能支撑 5,000 个用户.
16核心的CPU能支撑 10,000 个用户.
32核心的CPU能支撑 20,000 个用户.
64核心的CPU能支持多达 40,000 个用户.
你需要至少4GB的可寻址内存(RAM交换)来安装和使用GitLab!操作系统和任何其他正在运行的应用程序也将使用内存,因此请记住,在运行GitLab之前,您至少需要4GB的可用空间。使用更少的内存GitLab将在重新配置运行期间给出奇怪的错误,并在使用过程中发生500个错误.
1GBRAM + 3GB of swap is the absolute minimum but we strongly adviseagainst this amount of memory. See the unicorn worker section belowfor more advice.
2GBRAM + 2GB swap supports up to 100 users but it will be very slow
4GBRAM isthe recommended memory size for all installations and supportsup to 100 users
8GBRAM supports up to 1,000 users
16GBRAM supports up to 2,000 users
32GBRAM supports up to 4,000 users
64GBRAM supports up to 8,000 users
128GBRAM supports up to 16,000 users
256GBRAM supports up to 32,000 users
建议服务器上至少有2GB的交换,即使您目前拥有足够的可用RAM。如果可用的内存更改,交换将有助于减少错误发生的机会。
#Unicorn Workers(进程数)
可以增加独角兽工人的数量,这通常有助于减少应用程序的响应时间,并增加处理并行请求的能力.
对于大多数情况,我们建议使用:CPU内核1 =独角兽工人。所以对于一个有2个核心的机器,3个独角兽工人是理想的。
对于所有拥有2GB及以上的机器,我们建议至少三名独角兽工人。如果您有1GB机器,我们建议只配置两个Unicorn工作人员以防止过度的交换.
PostgreSQL
MySQL/MariaDB
强烈推荐使用PostgreSQL而不是MySQL/ MariaDB,因为GitLab的所有功能都不能与MySQL/ MariaDB一起使用。例如,MySQL没有正确的功能来以有效的方式支持嵌套组.
运行数据库的服务器应至少有5-10 GB的可用存储空间,尽管具体要求取决于GitLab安装的大小
#PostgreSQL要求
从GitLab 9.0起,PostgreSQL 9.2或更新版本是必需的,不支持早期版本。
#Redis and Sidekiq
Redis存储所有用户会话和后台任务队列。Redis的存储要求最低,每个用户大约25kB。
Sidekiq使用多线程进程处理后台作业。这个过程从整个Rails堆栈(200MB)开始,但是由于内存泄漏,它可以随着时间的推移而增长。在非常活跃的服务器(10,000个活跃用户)上,Sidekiq进程可以使用1GB的内存。
#Prometheus and its exporters
从Omnibus GitLab 9.0开始,默认情况下,Prometheus及其相关出口商启用,可以轻松,深入地监控GitLab。这些进程将使用大约200MB的内存,具有默认设置。这个还可以监控k8s
#Node exporter
节点导出器允许您测量各种机器资源,如内存,磁盘和CPU利用率。默认端口9100
#Redis exporter
Redis出口商允许您测量各种Redis指标。
#Postgres exporter
Postgres导出器允许您测量各种PostgreSQL度量。
#GitLab monitor exporter
GitLab监视器导出器允许您测量各种GitLab指标。
#Supported web browsers
支持Firefox,Chrome /Chromium,Safari和Microsoft浏览器(Microsoft Edge和Internet Explorer 11)的当前和之前的主要版本。
1、关闭SELinux
#下面的命令实现永久关闭SELinux
[root@git ~]# sed -i's/^SELINUX=.*/#&/;s/^SELINUXTYPE=.*/#&/;/SELINUX=.*/aSELINUX=disabled' /etc/sysconfig/selinux
#下面的命令实现临时关闭SELinux
[root@git ~]# setenforce 0
setenforce: SELinux is disabled
#永久修改下主机名,需要重启系统之后生效
Redhat6中修改
[root@git ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=git.server.com #修改成你自己的主机名
Redhat7中修改
[root@noede1 ~]# vi /etc/hostname
gitlab.server.com
[root@git ~]#hostnamectl set-hostname gitlab.server.com
[root@git ~]#cat /etc/hosts
192.168.201.131 gitlab.server.com
2、关闭firewall
[root@git yum.repos.d]# iptables -F
[root@git gitlab_pack]# systemctl stopfirewalld.service
#永久关闭,需要下次重启系统之后生效
[root@git gitlab_pack]# systemctl disablefirewalld.service
Removed symlink/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink/etc/systemd/system/basic.target.wants/firewalld.service.
#线上开启防火墙
[root@gitlab ~]# firewall-cmd --permanent--add-service=http
[root@gitlab ~]# firewall-cmd --permanent--add-service=https
[root@gitlab ~]# firewall-cmd --reload
#重新加载配置
[root@gitlab ~]#systemctl reload firewalld
3、同步时间
[root@git yum.repos.d]# ntpdate time.nist.gov
10 Apr 11:00:04 ntpdate[40122]: step timeserver 216.229.0.179 offset
4、配置gitlab-ce yum源
[root@git yum.repos.d]# cat gitlab.repo
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
gpgkey=https://packages.gitlab.com/gpg.key
如果想要在centos6系列上安装,只需把el7修改成el6
5、Gitlab安装方式
Gitlab两种安装方式
优点:可定制性强。数据库既可以选择MySQL,也可以选择PostgreSQL;服务器既可以选择Apache,也可以选择Nginx。
缺点:国外的源不稳定,被墙时,依赖软件包难以下载。配置流程繁琐、复杂,容易出现各种各样的问题。依赖关系多,不容易管理,卸载GitLab相对麻烦。
优点:安装过程简单,安装速度快。采用rpm包安装方式,安装的软件包便于管理。
缺点:数据库默认采用PostgreSQL,服务器默认采用Nginx,不容易定制。
gitlab安装
https://about.gitlab.com/downloads/#centos7
#如果想查看rpm中内容,默认安装的位置
[root@gitlab gitlab_pack]# rpm2cpiogitlab-ce-8.8.0-ce.0.el6.x86_64.rpm | cpio -ivd
[root@git yum.repos.d]# yum install curlopenssh-server openssh-clients postfix -y
[root@git yum.repos.d]# yum install gitlab-ce-8.8.0-y
#这里为了节省时间,直接rpm安装
[root@git gitlab_pack]# rpm -ivhgitlab-ce-8.8.0-ce.0.el6.x86_64.rpm
Preparing...
################################# [100%]
Updating / installing...
1:gitlab-ce-8.8.0-ce.0.el6
################################# [100%]
gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THEFOLLOWING COMMAND:
sudo gitlab-ctl reconfigure
gitlab: GitLab should be reachable athttp://localhost
gitlab: Otherwise configure GitLab for yoursystem by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab: For a comprehensive list ofconfiguration options please see the Omnibus GitLab readme
gitlab:https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
It looks like GitLab has no skipping the upgrade script.
至此gitlab安装成功
rpm 安装Gitlab的默认位置在/opt下
6、修改下配置文件
#修改url,供外部访问
[root@gitlab ~]# vi /etc/gitlab/gitlab.rb
external_url'http://gitlab.server.com'
external_url 修改成自己的ip或者域名
#修改配置文件之后,需要重新是配置文件生效下,初始化下
[root@gitlab ~]#gitlab-ctl reconfigure #这里会花费一定的时间(1-10min),如果这里内存小,将会花费大量时间
Recipe: gitlab::gitlab-rails
*execute[clear the gitlab-rails cache] action run
-execute /opt/gitlab/bin/gitlab-rake cache:clear
*execute[clear the gitlab-rails cache] action run
-execute /opt/gitlab/bin/gitlab-rake cache:clear
Recipe: gitlab::unicorn
*service[unicorn] action restart
-restart service service[unicorn]
Recipe: gitlab::redis
*ruby_block[reload redis svlogd configuration] action create
-execute the ruby block reload redis svlogd configuration
Recipe: gitlab::postgresql
*ruby_block[reload postgresql svlogd configuration] action create
-execute the ruby block reload postgresql svlogd configuration
Recipe: gitlab::unicorn
*ruby_block[reload unicorn svlogd configuration] action create
-execute the ruby block reload unicorn svlogd configuration
Recipe: gitlab::sidekiq
*ruby_block[reload sidekiq svlogd configuration] action create
-execute the ruby block reload sidekiq svlogd configuration
Recipe: gitlab::gitlab-workhorse
*service[gitlab-workhorse] action restart
-restart service service[gitlab-workhorse]
*ruby_block[reload gitlab-workhorse svlogd configuration] action create
-execute the ruby block reload gitlab-workhorse svlogd configuration
Recipe: gitlab::gitlab-workhorse
*service[gitlab-workhorse] action restart
-restart service service[gitlab-workhorse]
*ruby_block[reload gitlab-workhorse svlogd configuration] action create
-execute the ruby block reload gitlab-workhorse svlogd configuration
Recipe: gitlab::nginx
*ruby_block[reload nginx svlogd configuration] action create
-execute the ruby block reload nginx svlogd configuration
Recipe: gitlab::logrotate
*ruby_block[reload logrotate svlogd configuration] action create
-execute the ruby block reload logrotate svlogd configuration
Running handlers:
Running handlers complete
Chef Client finished, 222/309 resources updatedin 02 minutes 50 seconds
gitlab Reconfigured!#如果在此期间没有出现error,证明成功
7、启动Gitlab服务
[root@gitlab ~]# gitlab-ctl start
ok: down:gitaly: 0s, normally up
ok: down:gitlab-monitor: 1s, normally up
ok: down: gitlab-workhorse: 0s, normally up
ok: down: logrotate: 0s, normally up
ok: down: nginx: 0s, normally up
ok: down:node-exporter: 0s, normally up
ok: down:postgres-exporter: 1s, normally up
ok: down: postgresql: 0s, normally up
ok: down:prometheus: 1s, normally up
ok: down: redis: 0s, normally up
ok: down:redis-exporter: 0s, normally up
ok: down: sidekiq: 0s, normally up
ok: down: unicorn: 1s, normally up
绿色部分是9中新添加的
gitlab-workhorse这个“工作马”,就是gitlab-Git-http-server(GitlabV8.0出现,V8.2名称变更为Gitlab-workhorse)
sidekiq多线程启动
unicorn是ruby的http server,可以通过http://localhost:8080端口访问, 默认端口是8080
nginx作为方向代理,代理到unicorn,nginx默认端口是80
postgresql作为数据库,默认端口是5432
redis作为一个队列(NoSql),用于存储用户session和任务,任务包括新建仓库、发送邮件等等,默认端口是6379
logrotate切割日志
prometheus监控,默认端口9090
gitlab-monitor默认端口9168
(可选)如果系统资源不足,可以通过以下命令关闭Sidekiq来释放一部分内存
[root@gitlab ~]# gitlab-ctl stop sidekiq
ok: down: sidekiq: 0s, normally up
7.1 RPM安装模式下的启动、停止、重启
#初次配置服务
# gitlab-ctlreconfigure
# gitlab-ctl start
# gitlab-ctl stop
# gitlab-ctl restart
#gitlab-ctl status
#gitlab-ctl tailunicorn 监控unicorn日志
#gitlab-ctl tail
访问地址http://ip
由于第一次登陆,需要设置密码
登录之后的界面
Gitlab8的界面
Gitlab9版本
重新安装清理
[root@git Gitlab-cn]# rpm -e gitlab-ce
2,删除文件
[root@git Gitlab-cn]#rm -rf /etc/gitlab/*/var/log/gitlab/ /var/opt/gitlab/ /opt/gitlab/
[root@git .ssh]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
#8版本下载汉化包并汉化
[root@git hanhua]# git clonehttps://gitlab.com/larryli/gitlab.git Gitlab-cn && cd Gitlab-cn
#备份/opt/gitlab/embedded/service目录下的gitlab-rails目录,该目录下的内容主要是web应用部分
[root@git Gitlab-cn]#\cp -rf/opt/gitlab/embedded/service/gitlab-rails{,.ori}
#关闭gitlab这个服务
[root@git Gitlab-cn]#gitlab-ctl stop
[root@git gitlab_pack]# \cp -rf Gitlab-cn/*/opt/gitlab/embedded/service/gitlab-rails/
测试是否汉化成功
[root@git ~]# gitlab-ctl start
ok: run: gitlab-workhorse: (pid s
ok: run: logrotate: (pid s
ok: run: nginx: (pid s
ok: run: postgresql: (pid s
ok: run: redis: (pid s
ok: run: sidekiq: (pid s
ok: run: unicorn: (pid s
#9版本汉化
[root@gitlab ~]#
Cloning into 'gitlab'...
remote: Counting objects: 496150, done.
remote: Compressing objects: 100%(590), done.
remote: Total 496150 (delta 387041), reused495906 (delta 386824)Receiving objects: 100% (150), 220.14 MiB | 2
Resolving deltas: 100% (041), done.
Checking out files: 100% (), done
[root@gitlab ~]# cd gitlab/
[root@gitlab [9-1-stable-zh ≡]# git fetch
#生成补丁,进入到gitlab目录下
[root@gitlab gitlab]# git diff v9.1.2 v9.1.2-zh& ../9.1.2-zh.diff
[root@gitlab gitlab]# patch -d/opt/gitlab/embedded/service/gitlab-rails -p1 & ../9.1.2-zh.diff
2.5 Gitlab命令使用
gitlab-ctl command (subcommand)
Service Management Commands
启动所有服务
关闭所有服务
重启所有服务
查看所有服务状态
查看日志信息
service-list
列举所有启动服务
graceful-kill
平稳停止一个服务
#启动所有服务
[root@gitlab ~]# gitlab-ctl start
#启动单独一个服务
[root@gitlab ~]# gitlab-ctl start nginx
#查看日志,查看所有日志
[root@gitlab ~]# gitlab-ctl tail
#查看具体一个日志,类似tail -f
[root@gitlab ~]# gitlab-ctl tail nginx
reconfigure
修改配置文件之后,需要重新加载下
show-config
查看所有服务配置文件信息
卸载这个软件
删除gitlab数据,重新白手起家
#显示所有服务配置文件
[root@gitlab ~]#gitlab-ctl show-config
#卸载gitlab
[root@gitlab ~]#gitlab-ctl uninstall
(慎重使用)
Database Commands
pg-upgrade
更新postgresql版本
revert-pg-upgrade
还远先前的(离现在正在使用靠近的版本)一个数据库版本
#升级数据库
[root@gitlab ~]# gitlab-ctl pg-upgrade
Checking for an omnibus managed postgresql: OK
Checking if we already upgraded: OK
The latest version 9.6.1 is already running,nothing to do
#降级数据库版本
[root@gitlab ~]# gitlab-ctl revert-pg-upgrade
Toggling deploy page:cp/opt/gitlab/embedded/service/gitlab-rails/public/deploy.html/opt/gitlab/embedded/service/gitlab-rails/public/index.html
Toggling deploy page: OK
Toggling services:ok: down: gitaly: 129s,normally up
ok: down: gitlab-monitor: 128s, normally up
ok: down: logrotate: 127s, normally up
ok: down: node-exporter: 127s, normally up
ok: down: postgres-exporter: 126s, normally up
ok: down: prometheus: 125s, normally up
ok: down: redis-exporter: 125s, normally up
ok: down: sidekiq: 123s, normally up
Toggling services: OK
Checking if we need to downgrade: NOT OK
/var/opt/gitlab/postgresql/data.9.2.18 does notexist, cannot revert data
Will proceed with reverting the running programversion only, unless you interrupt
Reverting database to
9.2.18 in 5 seconds
=== WARNING ===
This will revert the database to what it wasbefore you upgraded, including the data.
Please hit Ctrl-C now if this isn't what youwere looking for
=== WARNING ===
== Reverting ==
ok: down: postgresql: 131s, normally up
ok: run: postgresql: (pid 12102) 0s
== Reverted ==
Toggling deploy page:rm -f/opt/gitlab/embedded/service/gitlab-rails/public/index.html
Toggling deploy page: OK
Toggling services:ok: run: gitaly: (pid 12107)1s
ok: run: gitlab-monitor: (pid 12111) 0s
ok: run: logrotate: (pid 12115) 1s
ok: run: node-exporter: (pid 12121) 0s
ok: run: postgres-exporter: (pid 12125) 0s
ok: run: prometheus: (pid 12130) 1s
ok: run: redis-exporter: (pid 12139) 0s
ok: run: sidekiq: (pid 12144) 1s
Toggling services: OK
2.6 gitlab配置详解
gitlab配置文件
/etc/gitlab/gitlab.rb
unicorn配置文件
/var/opt/gitlab/gitlab-rails/etc/unicorn.rb
nginx配置文件
/var/opt/gitlab/nginx/conf/gitlab-http.conf
gitlab仓库默认位置
/var/opt/gitlab/git-data/repositories
#修改web端口
如果80和8080端口被占用可以修改
[root@gitlabgitlab_pack]# vi /var/opt/gitlab/gitlab-rails/etc/unicorn.rb
listen"127.0.0.1:8080", :tcp_nopush =& true #这一行端口修改为你要端口
#修改nginx端口
[root@gitlabgitlab_pack]# vi /var/opt/gitlab/nginx/conf/gitlab-http.conf
server{ #这里的80端口修改为你所需要的端口
listen *:80;
只要修改了配置文件一定要重新加载配置
#修改Prometheus端口
#Prometheus默认端口是9090
[root@gitlabgitlab_pack]# vi /etc/gitlab/gitlab.rb
#根据自己情况自行修改成自己需要的port
#修改项目工程数量
默认安装好,你能创建的项目,只能创建10个
#第一种方式修改
[root@gitlab gitlab_pack]# vi/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb
Settings.gitlab['default_projects_limit'] ||=10
修改成你自己所需要的参数,保存
Settings.gitlab['default_projects_limit'] ||=10000
#重新初始化
[root@gitlab postgresql]# gitlab-ctlreconfigure
#查看修改之后项目数量
这个是在安装完gitlab之后修改,如果已经使用一段时间,在修改项目的数量,需要你自己在自己的用户下修改,第二次初始化,会缩短时间
#第二种方式修改
#首先登录gitlab
#点击Adminstrator这个用户
#关闭注册功能
默认注册功能是开启的, 对于个人的gitlab, 没有对外公布的必要
#首先点击管理区域---à在点击设置按钮
找到注册限制
选中,然后保存
[root@gitlab gitlab_pack]# gitlab-ctl stop
[root@gitlabgitlab_pack]# vi /etc/gitlab/gitlab.rb
把true改成false
prometheus_monitoring['enable']= true
prometheus_monitoring['enable']= false
#重新加载配置文件
[root@gitlabgitlab_pack]# gitlab-ctl reconfigure
[root@gitlab gitlab_pack]# gitlab-ctl start
ok: run: gitaly: (pid 21611) 0s
ok: run: gitlab-workhorse: (pid 21615) 1s
ok: run: logrotate: (pid 21622) 0s
ok: run: nginx: (pid 21628) 1s
ok: run: postgresql: (pid 21633) 0s
ok: run: redis: (pid 21641) 0s
ok: run: sidekiq: (pid 21645) 1s
ok: run: unicorn: (pid 21648) 0s
#很显然没有prometheus这个服务
2.7 gitlab安全
#Custom password length limits
初始化器的密码长度设置为最少8个字符
[root@gitlab opt]# cd/opt/gitlab/embedded/service/gitlab-rails/config/initializers
[root@gitlab initializers]#cpdevise_password_length.rb.example devise_password_length.rb
#重启gitlab服务
#Rack attack
默认情况下,用户登录,用户注册(如果启用)和用户密码重置被限制为每分钟6个请求。尝试6次后,客户端将不得不等待下一分钟再次尝试。
如果发现节流不足以保护您免遭滥用客户端,机架式攻击宝石提供IP白名单,黑名单,Fail2ban样式过滤器和跟踪。
[root@gitlab opt]# cd/opt/gitlab/embedded/service/gitlab-rails/config/initializers
[root@gitlab initializers]#
cp rack_attack.rb.example rack_attack.rb
#编辑application.rb
[root@gitlab config]#vi/opt/gitlab/embedded/service/gitlab-rails/config/application.rb
config.middleware.use Rack::Attack
#重新启动GitLab实例
#Information exclusivity
是分布式版本控制系统(DVCS)。这意味着每个与源代码一起工作的人都具有完整存储库的本地副本。在GitLab中,不是客人的所有项目成员(因此,记者,开发人员和主人)都可以克隆资料库以获取本地副本。获取本地副本后,用户可以随时上传完整的存储库,包括其控制下的另一个项目或其他服务器。结果是您无法构建访问控制,阻止有权访问源代码的用户有意共享源代码。这是DVCS的固有特性,所有git管理系统都有这个限制。很明显,你可以采取措施,防止意外分享和破坏信息,这就是为什么只有一些人被允许邀请他人,没有人可以强制推行一个受保护的分支机构。
#How to reset your root password
Loading production environment (Rails 4.2.8)
irb(main):001:0&
user = User.where(id: 1).first#查看信息
=& #&User id: 1, email: "",created_at: " 09:04:59", updated_at: "7:18:16", name: "Administrator", admin: true, projects_limit:100000, skype: "", linkedin: "", twitter: "",authentication_token:
"k44aWyAaaaJaHYx4B_QP", bio: nil, username:"root", can_create_group: true, can_create_team: false, state:"active", color_scheme_id: 1, password_expires_at: nil,created_by_id: nil, last_credential_check_at: nil, avatar: nil,hide_no_ssh_key: false, website_url:
"", notification_email:"", hide_no_password: false, password_automatically_set:false, location: nil, encrypted_otp_secret: nil, encrypted_otp_secret_iv: nil,encrypted_otp_secret_salt: nil, otp_required_for_login: false,otp_backup_codes: nil,
public_email: "", dashboard: 0, project_view:2, consumed_timestep: nil, layout: 0, hide_project_limit: false,otp_grace_period_started_at: nil, ldap_email: false, external: false,incoming_email_token: "9wt82lanyjoakil3asrhfevvh", organization: nil,authorized_projects_populated:
true, ghost: nil, last_activity_on: nil, notified_of_own_activity:false, require_two_factor_authentication_from_group: false,two_factor_grace_period: 48&
irb(main):002:0&
user.password = 'admin123' #设置新的密码
=& "admin123"
irb(main):003:0&
user.password_confirmation = 'admin123' #验证密码
=& "admin123"
irb(main):004:0&
user.save! #保存密码
Enqueued ActionMailer::DeliveryJob (Job ID:b2ba5d30-853c-405d-8d95-fa938d88f32c) to Sidekiq(mailers) with arguments:"DeviseMailer", "password_change", "deliver_now",gid://gitlab/User/1
irb(main):005:0& #ctrl+d退出
#User email confirmation at sign-up
如果您想在所有用户电子邮件登录之前确认,Gitlab管理员可以在注册时启用电子邮件确认。
2.8 gitlab集群
2.9 GitLab Runner 构建任务
官方:https://docs.gitlab.com/runner/
是用于运行作业并将结果发送回GitLab的开源项目。它与GitLab CI结合使用,GitLab CI是GitLab中协调工作的开源连续集成服务。
#Requirements
是用Go编写的,可以作为一个二进制文件运行,不需要任何语言特定的要求。它被设计为在GNU / Linux,macOS和Windows操作系统上运行。只要您可以编译一个Go二进制文件,其他操作系统就可能会工作。
Allows to run
多个工作同时进行)use multiple tokens with multiple server (even per-project)( 使用多个令牌与多个服务器(甚至每个项目))limit number of concurrent jobs per-token(限制每个令牌的并发作业数)Jobs can be run
本地)using Docker containers(使用Docker容器)using Docker containers and executing job over SSH(使用Docker容器并通过SSH执行作业)using Docker containers with autoscaling on different clouds and virtualization hypervisors(使用Docker容器在不同的云和虚拟化管理程序上进行自动缩放)connecting to remote SSH server(连接到远程SSH服务器)#安装
安装gitlab-ci-multi-runner源
[root@gitlab ~]#curl -Lhttps://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh| sudo bash
[root@gitlab ~]#
#gitlab-runner使用
必须是在8版本以上才能使用这个集成功能
https://docs.gitlab.com/runner/commands/README.html
gitlab-runner
gitlab-runner[global options] command [command options] [arguments...]
显示runner配置文件
运行多个runner服务
注册一个新的runner
启动一个服务
停止一个服务
一个服务状态
run-single
运行单独的一个runner
unregister
注销特定的runner
验证所有注册的runner
artifacts-downloader
downloadand extract build artifacts (internal)
artifacts-uploader
create andupload build artifacts (internal)
cache-archiver
create and uploadcache artifacts (internal)
cache-extractor
download andextract cache artifacts (internal)
[root@gitlab ~]# gitlab-runner list
Listing configured runners
ConfigFile=/etc/gitlab-runner/config.toml
[root@gitlab ~]# gitlab-runner --debug
Runtime platform
arch=amd64 os=linuxrevision=0118d89 version=9.1.0
Listing configured runners
ConfigFile=/etc/gitlab-runner/config.toml
gitlab-ci-multi-runner
[root@gitlab gitlab]# gitlab-ci-multi-runnerregister --help
Runner类型
GitLab-Runner可以分类两种类型:
(共享型)
Specific Runner(指定型)。
Shared Runner:
这种Runner(工人)是所有工程都能够用的。只有系统管理员能够创建Shared Runner。
Specific Runner:
这种Runner(工人)只能为指定的工程服务。拥有该工程访问权限的人都能够为该工程创建Shared Runner。
注册runner
1,copy 注册授权码
2,register
安装好gitlab-ci-multi-runner这个软件之后,我们就可以用它向GitLab-CI注册Runner了。
向GitLab-CI注册一个Runner需要两样东西:GitLab-CI的url和注册token。
其中,token是为了确定你这个Runner是所有工程都能够使用的Shared Runner还是具体某一个工程才能使用的Specific Runner
#查看register帮助
[root@gitlab gitlab]# gitlab-ci-multi-runnerregister --help
#注册Shared Runner
在注册Runner的时候,需要填入Token,GitLab根据不同的Token确定这个Runner是被设置为Shared Runner还是Specific Runner
[root@gitlab gitlab]# gitlab-ci-multi-runnerregister
Running in system-mode.
Please enter the gitlab-ci coordinator URL(e.g. https://gitlab.com/):
http://192.168.201.148/ci#输入ci
Please enter the gitlab-ci token for thisrunner:
2RBdZavdy6UsZvbyCcMF#注册授权码
Please enter the gitlab-ci description for thisrunner:
[gitlab.server.com]:
test_runner #描述
Please enter the gitlab-ci tags for this runner(comma separated):
hello_tom #写个标签,可以多个,用逗号隔开
Whether to run untagged builds [true/false]:
[false]: #输入回车
Whether to lock Runner to current project[true/false]:
Registering runner... succeeded
runner=2RBdZavd
Please enter the executor:
virtualbox, docker-ssh+machine,kubernetes, parallels, shell, ssh, docker+machine, docker, docker-ssh:
shell #输入选择通讯方式
Runner registered successfully. Feel free tostart it, but if it's running already the config should be automaticallyreloaded!
#查看服务是否运行
[root@gitlab gitlab]# ps -ef|grep runner
00:00:02/usr/bin/gitlab-ci-multi-runner run --working-directory /home/gitlab-runner --config/etc/gitlab-runner/config.toml --service gitlab-runner --syslog --usergitlab-runner
如果不运行gitlab-ci-multi-runner register命令,直接在配置文件里面添加Runner的配置信息可以吗
当然不行。因为gitlab-ci-multi-runner register的作用除了把Runner的信息保存到配置文件以外,还有一个很重要的作用,那就是向GitLab-CI发出请求,在GitLab-CI中登记这个Runner的信息并且获取后续通信所需要的token。
3,查看register
http://my_url/admin/runners
#查看gitlab-runner配置文件
[root@gitlab ~]# cat/etc/gitlab-runner/config.toml
concurrent = 1
check_interval = 0
[[runners]]
name ="test_ci"
url ="http://192.168.201.148/ci"
token ="c6f62fe5a2b4ec072f5cc2fb096c02"
executor = "shell"
[runners.cache]
4,运行runner
要让一个Runner运行起来,--url、--token和--executor选项是必要的.
[root@gitlab gitlab]# gitlab-ci-multi-runnerrun-single --help
[root@gitlab ~]# gitlab-ci-multi-runner install--user=gitlab-runner --working-directory=/home/gitlab-runner
[root@gitlab ~]# gitlab-ci-multi-runner status
gitlab-runner: Service is running!
[root@gitlab test]# gitlab-ci-multi-runner list
Listing configured runners
ConfigFile=/etc/gitlab-runner/config.toml
Executor=shell Token=8bfcd3b988ae0a355273URL=http://192.168.201.149/ci
从7.12版本开始,GitLab CI使用YAML 文件(.gitlab-ci.yml)来配置project's builds
.gitlab-ci.yml 使用YAML语法, 需要格外注意缩进格式,要用空格来缩进,不能用tabs来缩进。
3.0 实战测试
http客户端测试
#创建测试目录
[root@client ~]# mkdir test2
[root@client ~]# cd test2
#把服务器的上仓库clone下来
[root@cleint test2]# git clone http://gitlab.server.com/root/test.git
Cloning into 'test'...
warning: You appear to have cloned an emptyrepository.
Checking connectivity... done.
[root@cleint test2]# git clone http://gitlab.server.com/root/test.git
Username for 'http://git.server.com':root
Password for 'http://root@git.server.com':adminroot
Counting objects: 3, done.
Writing objects: 100% (3/3), 216 bytes | 0bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://git.server.com/root/go.git
* [newbranch]
master -& master
Branch master set up to track remote branchmaster from origin.
[root@git test2]# ls
[root@cleint test2]# git config --globaluser.name "Administrator"
[root@client test2]# git config --globaluser.email ""
[root@client test2]# cd test/
[root@client test]# touch README.md
[root@client test]# vi README.md
[root@client test]# git add README.md
[root@client test]# git commit -m "addREADME"
[master (root-commit) 874889b] add README
1 filechanged, 1 insertion(+)
createmode 100644 README.md
[root@client test]# git push -u origin master
Username for 'http://git.server.com': root
Password for 'http://root@gitlab.server.com': adminroot
Counting objects: 3, done.
Writing objects: 100% (3/3), 223 bytes | 0bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://git.server.com/root/test.git
* [newbranch]
master -& master
Branch master set up to track remote branchmaster from origin.
从web上查看test仓库下是否上传了README.md这个文件
#查看是否成功
ssh客户端测试
[root@node6 .ssh]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key(/root/.ssh/id_rsa):
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:
d9:0d:43:2b:17:cc:3b:01:fa:c9:cb:2c:6e:b7:27:6droot@node6
The key's randomart image is:
+--[ RSA 2048]----+
+-----------------+
[root@node6 .ssh]#
[root@node6 .ssh]# ls
id_rsa id_rsa.pub
[root@node6 .ssh]# cat id_rsa.pub
ssh-rsaAAAAB3NzaC1yc2EAAAABIwAAAQEAoOLsYhPPlHPOnGh6SoVDPlVn2o8rfO55J60Gz7E0EDB0ugKgTu4VGOE8vVta7HH5exNAjw2UqHIliYcmVvrj5eFbvXLdLYGypiMfuP4H7dVwGXfxSzeG17aIbZma0fpB2bTQr3tN+nVA7tokVSmO+jC61/H6Qj9G1TEiedq0wtTuSQ8pza5hyeWRO9oi0W7ccZkYg7lSQ3Eo2n2/RJbmQHWdIcoBO8c64h5vq/gB1s7ZjHKUjSFvGTyHu7uYE6yD2PXylavLfq2FHUc4syV8yAvyW2ehgIcc+xDWMFC85SNuPvTOt0YNzG628gWB2lm+D8CPhZBUbz2IUkFN0jEdyQ==root@node6
#添加域名(如果是真实的域名,这步不需要做)
[root@node6 .ssh]# vi /etc/hosts
192.168.201.131 git.server.com
#添加到gitlab上
#测试ssh是否可用
[root@node6 .ssh]# ssh -T git@gitlab.server.com
The authenticity of host 'git.server.com(192.168.201.134)' can't be established.
RSA key fingerprint is45:1f:76:55:cb:72:fe:65:22:75:10:eb:d5:2e:35:d5.
Are you sure you want to continue connecting(yes/no)?yes
Warning: Permanently added'git.server.com,192.168.201.134' (RSA) to the list of known hosts.
Welcome to GitLab, Administrator!
[root@node6 .ssh]# git clone git@gitlab.server.com:root/test.git
Initialized empty Git repository in/root/.ssh/test/.git/
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), 223 bytes, done
Gitlab-runner
在创建register之前,需要拿到token和ci地址
1,找到你要register的项目地址
2,进入到这个项目
3,点击设置
4,点击pipline,查看token和ci
[root@gitlab test]# gitlab-ci-multi-runnerregister
#查看register
http://my_url/admin/runners
#查看gitlab-runner配置文件
[root@gitlab ~]# cat/etc/gitlab-runner/config.toml
concurrent = 1
check_interval = 0
[[runners]]
name ="test_ci"
url ="http://192.168.201.148/ci"
token ="c6f62fe5a2b4ec072f5cc2fb096c02"
executor = "shell"
[runners.cache]
#配置pipline
1,打开runner
2,编辑runner
#clone仓库
[root@gitlab test]# git clone
[root@gitlab test]#cd test
#创建gitlab-ci.yml文件
[root@gitlab test]# cat .gitlab-ci.yml
stage:test
-echo "I am job1"
- echo "I am intest stage"
#上传到gitlab仓库中
[root@gitlab test]# git add .gitlab-ci.yml
[root@gitlab test]# git commit -m"kskksksk"
[master 9376c70] kskksksk
1 filechanged, 1 insertion(+), 1 deletion(-)
[root@gitlab test]# git push origin master
Password for 'http://root@gitlab.server.com':
Counting objects: 5, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 363 bytes | 0bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To http://root@gitlab.server.com/root/test.git
df0b7b4..9376c70
master -&master
#点击passwd
没有更多推荐了,}

我要回帖

更多关于 gitlab 10汉化 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信