centos6使用yum源安装gitlab-ce私有环境

  1. 使用清华镜像源配置yum源:

  vim /etc/yum.repos.d/gitlab.repo 

1
2
3
4
5
[Gitlab-CE]
name=Gitlab CE
baseurl=https: //mirror .tuna.tsinghua.edu.cn /gitlab-ce/yum/el6/
enabled=1
gpgcheck=0

2. yum安装

 yum install gitlab-ce -y

3. gitlab配置(/opt/gitlab/gitlab.rb)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
external_url '  #配置服务器IP地址或域名
 
#配置e-mail
gitlab_rails[ 'time_zone' ] =  'UTC'
gitlab_rails[ 'gitlab_email_enabled' ] =  true
gitlab_rails[ 'gitlab_email_from' ] =  'gitlab2015@163.com'
gitlab_rails[ 'gitlab_email_display_name' ] =  'APICloud_Gitlab'
gitlab_rails[ 'gitlab_email_reply_to' ] =  'gitlab2015@163.com' 
 
gitlab_rails[ 'smtp_enable' ] =  true
gitlab_rails[ 'smtp_address' ] =  "smtp.163.com"
gitlab_rails[ 'smtp_port' ] = 25
gitlab_rails[ 'smtp_user_name' ] =  "gitlab2015@163.com"
gitlab_rails[ 'smtp_password' ] =  "nxgfvizafijytymx"
gitlab_rails[ 'smtp_domain' ] =  "163.com"
gitlab_rails[ 'smtp_authentication' ] =  "login"
gitlab_rails[ 'smtp_enable_starttls_auto' ] =  true
gitlab_rails[ 'smtp_tls' ] =  false
 
 
gitlab_ci[ 'smtp_enable' ] =  true
gitlab_ci[ 'smtp_address' ] =  "smtp.163.com"
gitlab_ci[ 'smtp_port' ] = 25
gitlab_ci[ 'smtp_user_name' ] =  "gitlab2015@163.com"
gitlab_ci[ 'smtp_password' ] =  "nxgfvizafijytymx"
gitlab_ci[ 'smtp_domain' ] =  "163.com"
gitlab_ci[ 'smtp_authentication' ] =  "login"
gitlab_ci[ 'smtp_enable_starttls_auto' ] =  true

4. gitlab命令

  1. 重置配置,使修改生效

1
gitlab-ctl reconfigure

b. 登录测试

1
2
Username: root (管理员账号)
Password: 5iveL!fe

c. 解决gitlab默认头像不能正常显示的问题

1
2
gitlab_rails[ 'gravatar_plain_url' ] =  'http://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
gitlab_rails[ 'gravatar_ssl_url' ] =  'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'

5. 开机自启动脚本设置

1
2
3
4
5
6
7
vim  /opt/startGitlab .sh
==========================
#! /bin/bash 
sudo  lokkit -s http -s  ssh
==========================
echo  "/opt/startGitlab.sh"  >> vim   /etc/rc .d /rc . local
================================================

6. 数据备份与恢复

1
2
3
4
数据备份及恢复命令:
备份path: /var/opt/gitlab/backups  (备份和恢复文件都是git用户)
数据备份:gitlab-rake gitlab:backup:create
数据恢复:gitlab-rake gitlab:backup:restore

使用Gitlab一键安装包后的日常备份恢复与迁移 https://segmentfault.com/a/1190000002439923

1
2
3
4
5
6
7
8
9
创建备份:gitlab-rake gitlab:backup:create
恢复备份:
# 停止相关数据连接服务
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# 从1393513186编号备份中恢复
gitlab-rake gitlab:backup:restore BACKUP=1393513186
# 启动Gitlab
sudo  gitlab-ctl start

7. 参考链接:

1
http: //swht1278 .blog.51cto.com /7138082/1643939










本文转自 南非波波 51CTO博客,原文链接:http://blog.51cto.com/nanfeibobo/1837370,如需转载请自行联系原作者
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值