gitlab搭建
admin
2023-02-21 15:20:04
0次

gitlab官网 https://about.gitlab.com/gitlab-com/
官方安装文档 https://about.gitlab.com/installation/?version=ce#centos-7 (ce/ee)
要求服务器内存不少于2g
国外比较慢,所以我们用国内源

vim /etc/yum.repos.d/gitlab.repo//加入如下内容
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1

yum install -y gitlab-ce
gitlab-ctl reconfigure

netstat -lnpt //查看监听端口
gitlab-ctl stop/restart/start/status
浏览器访问gitlab,输入ip即可
注意如果访问502,注意是否有端口冲突,最好启动gitlab前关闭所有之前搭建的服务
默认管理员root,无密码,它会让我们去定义一个密码
gitlab常用命令 https://www.cnyunwei.cc/archives/1204
gitlab备份 gitlab-rake gitlab:backup:create
备份目录在/var/opt/gitlab/backups
gitlab 恢复 先停服务 gitlab-ctl stop unicorn ; gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore BACKUP=xxxxx (这里是一个编号,即备份文件的前缀)
例如:
gitlab-rake gitlab:backup:restore BACKUP=1511704184_2017_11_26_10.2.1

再启动服务 gitlab-ctl start

rpm安装:(centos6.5)
安装依赖:
yum install curl openssh-server openssh-clients postfix cronie
rpm地址:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-8.0.5-ce.0.el6.x86_64.rpm
下载:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-8.0.5-ce.0.el6.x86_64.rpm
安装:
rpm -ivh gitlab-ce-8.0.5-ce.0.el6.x86_64.rpm
gitlab-ctl reconfigure
启动:
gitlab-ctl start

汉化:
其他版本可参考:http://blog.csdn.net/wh311212/article/details/72627803
#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 1407) 263s
ok: run: logrotate: (pid 1403) 263s
ok: run: nginx: (pid 1404) 263s
ok: run: postgresql: (pid 1405) 263s
ok: run: redis: (pid 1402) 263s
ok: run: sidekiq: (pid 1400) 263s
ok: run: unicorn: (pid 1401) 263s
登录
http://192.168.201.131/users/sign_in

GitLab 项目创建后地址由Localhost改为实际IP的方法
进入终端修改以下文件即可。
vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml

GitLab settings

gitlab:

Web server settings (note: host is the FQDN, do not include http://)

host: localhost         >> 这里改为主机的IP即可
port: 80
https: false

# Uncommment this line below if your ssh host is different from HTTP/HTTPS one
# (you'd obviously need to replace ssh.host_example.com with your own host).
# Otherwise, ssh host will be set to the `host:` value above

重启GitLab
gitlab-ctl restart

git clean 参数
-n 显示 将要 删除的 文件 和 目录
-f 删除 文件,-df 删除 文件 和 目录

相关内容

热门资讯

空调连续工作多久需要停机休息 空调连续工作的时间取决于多个因素,包括空调的型号、功率、使用环境和维护情况等。一般来说,空调可以连续...
空调哪个符号是除湿的 空调除湿功能通常用一个水滴形状的符号表示。不同品牌和型号的空调遥控器可能会有所差异,但一般来说,除湿...
格力空调多长时间加一次氟利昂 1、一般情况下,空调对氟利昂的使用量是非常小的,所以在空调使用了四年左右的时候再考虑加也没问题。2、...
空调用多长时间需要加氟一次 一般情况下是五年。当出现以下这几种情况时,空调才需要加氟。1、空调的室内机和室外机各有两个接口,当接...
格调生活·C标思享荟:卡萨帝在... 9月12日的郑州龙湖金融岛,夜风轻拂,灯光璀璨。“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑...
品牌价值破千亿、高端份额持续领... 9月12日,“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑州站”在郑州龙湖金融岛举办。2026...
空调主板坏了修800还是换新的 空调主板坏了是修还是换新,需要考虑多个因素,以下是一些建议:1. 维修成本:如果维修费用较低,比如 ...
空调开多久需要休息多长时间 问题:空调开多久需要休息多长时间回答:1、在使用空调的过程中,一般空调开7~8个小时左右需要休息2~...
中央空调多长时间清洗一次 1、一般空调开机前清洗一次即可,空调开机中间时段再清洗一次,空调关机时清洗一次,这样比较合理。2、空...
中央空调氟利昂多久加一次 看空调制热和制冷程度,很多人的观点认为氟利昂必须一年放一次,其实这个观点是错误的,理解上面有点偏差,...