gitlab git clone 输入密码_gitlab1:部署gitlab

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        #自动安装最新版

aee2d1ec023aa556bdfd48f59bb8a29d.png

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

启动gitlab

sudo gitlab-ctl reconfigure        # 启动服务;

查看版本号:

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

7355951bf273e3662334080ea42f73c3.png

修改访问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 $i $i".git"
> done

仓库目录默认位置: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

c751aba19777a0ff1388b444b8210fc5.png

设置密码: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              #删除所有数据,从新开始

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值