gitlab搭建

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

创新互联公司专注于企业营销型网站、网站重做改版、新田网站定制设计、自适应品牌网站建设、H5建站商城网站开发、集团公司官网建设、外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为新田等各大城市提供网站开发制作服务。

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 删除 文件 和 目录


网站名称:gitlab搭建
新闻来源:http://csdahua.cn/article/jeiiii.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流