GitLab搭建与日常维护

Gitlab服务命令:

启动所有 gitlab 组件;sudo gitlab-ctl start
停止所有 gitlab 组件;sudo gitlab-ctl stop
重启所有 gitlab 组件;sudo gitlab-ctl restart
查看服务状态;sudo gitlab-ctl status
启动服务(再次加载配置);sudo gitlab-ctl reconfigure
修改默认的配置文件;sudo vim /etc/gitlab/gitlab.rb
检查gitlab;gitlab-rake gitlab:check SANITIZE=true --trace
查看日志;sudo gitlab-ctl tail

添加GitLab镜像源并安装gitlab服务器

https://mirrors.tuna.tsinghua.edu.cn/ 清华大学开源软件镜像站
1、添加gitlab镜像
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.7.3-ce.0.el7.x86_64.rpm
2、安装gitlab 安装命令:
rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
3、修改gitlab配置文件指定服务器ip和自定义端口:
vim /etc/gitlab/gitlab.rb
external_url ‘http://localost:8090’
4、重置并启动GitLab
gitlab-ctl reconfigure
gitlab-ctl stop
gitlab-ctl start

日常维护

重置管理员的密码

1、进入 GitLab 控制台
gitlab-rails console -e production
2、执行命令: user = User.where(id: 1).first,此 user 则表示 root 用户
3、修改密码
执行命令:
user.password = ‘secret_pass’ 修改密码,
user.password_confirmation = ‘secret_pass’ 确认密码
4、保存密码
执行命令: user.save!
5、退出控制台
执行命令: exit

重制其他用户密码:

1、进入 GitLab 控制台
gitlab-rails console -e production
2、通过邮箱找到用户
user=User.where(email:‘jenkins@domian.com’).first
3、重置密码
user.password=12345678
4、确认密码
user.password_confirmation=12345678
5、并保存
user.save!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值