gitlab安装流程

作者:蓝眼泪

实验环境:centos7.6 ,xshell7,vm15

1 安装依赖

sudo yum install -y curl policycoreutils-python openssh-server openssh-clients perl
sudo systemctl enable sshd
sudo systemctl start sshd


2 关闭防火墙

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld


3 安装邮箱

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix


4 脚本安装

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash


5 更新gitlab-ce软件

sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ce
sudo EXTERNAL_URL="http://192.168.1.200" yum install -y gitlab-ce

6 初始化配置并启动软件

gitlab-ctl reconfigure
gitlab-ctl start

  gitlabctl其他常用操作命令

# 重新应用gitlab的配置
gitlab-ctl reconfigure
 
# 重启gitlab服务
gitlab-ctl restart
 
# 查看gitlab运行状态
gitlab-ctl status
 
#停止gitlab服务
gitlab-ctl stop
 
# 查看gitlab运行日志
gitlab-ctl tail

7 修改external_url参数

vim /etc/gitlab/gitlab.rb 

搜索external_usl 更改参数

/external_url
external_url :'http://192.168.1.200’

8 登录网页测试

http://192.168.1.200/root
http://192.168.1.200/api/v4/users?username=root


  注意事项
1 设置yum源,加速软件下载

cat> /etc/yum.repos.d/gitlab-ce.repo<< EOF
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/  
gpgcheck=0
enabled=1
EOF

2 root账号密码忘记解决方案

gitlab-rails console
user = User.where(id: 1).first
user = User.find_by(email: 'admin@local.host')
user.password = '2.0.2.0.Wen'
user.password_confirmation = '2.0.2.0.Wen'
user.save!
exit

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值