前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >gitlab-1:部署gitlab

gitlab-1:部署gitlab

作者头像
千里行走
发布2020-10-27 10:13:33
8410
发布2020-10-27 10:13:33
举报
文章被收录于专栏:千里行走千里行走

1、配置yum源

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

复制以下内容:

[gitlab-ce]

name=Gitlab CE Repository

baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/

gpgcheck=0

enabled=1

2、更新本地yum缓存

sudo yum makecache

3、安装GitLab社区版

sudo yum install gitlab-ce #自动安装最新版

sudo yum install gitlab-ce-x.x.x #安装指定版本

启动gitlab

sudo gitlab-ctl reconfigure # 启动服务;

查看版本号:

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

修改访问hostURL,修改/etc/gitlab/gitlab.rb中的配置:默认是机器名

external_url 'http://future'

4.相关配置

现在所做的步骤就是把之前的gitlab的所有仓库都复制到现在新的gitlab repo的目录下,并设置相应权限:git:git。

然后使用命令导入仓库:

sudo gitlab-rake gitlab:import:repos

注意,如上命令只能导入工程后缀是.git的工程,给工程增加后缀名:

root@iZ:/home#for i in *> do mv

仓库目录默认位置:git_data_dir "/var/opt/gitlab/git-data"

gitlab配置文件位于:/etc/gitlab/gitlab.rb

#git_data_dir "/var/opt/gitlab/git-data"

5.修改密码

sudo gitlab-rails console production

查出admin账户:

u=User.where(id:1).first

设置密码:u.password=12345678

保存:u.save!

密码修改完成。quit命令退出命令行。

6.登陆

修改host:

ip future

浏览器访问:http://future

输入用户名密码:

user: admin@example.com

pwd: 12345678

7.GitLab常用命令

sudo gitlab-ctl start # 启动所有 gitlab 组件;

sudo gitlab-ctl stop # 停止所有 gitlab 组件;

sudo gitlab-ctl restart # 重启所有 gitlab 组件;

sudo gitlab-ctl status # 查看服务状态;

sudo gitlab-ctl reconfigure # 启动服务;

sudo vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;

gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;

sudo gitlab-ctl tail # 查看日志;

gitlab-ctl cleanse #删除所有数据,从新开始

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-10-12,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 千里行走 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档