国内debian8-10系列部署gitlab-ce最新社区版
1.配置国内源
#编辑软件源配置文件,将对应系统版本的阿里云软件源加进去
vim /etc/apt/sources.list
debian8:
deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib
debian9:
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
debian10:
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
#编辑添加对应系统版本的gitlab软件源,然后更新
deb http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian jessie main
debian9:
deb http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian stretch main
debian10:
deb http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian buster main
#更新软件列表
apt-get update
2.安装GitLab依赖项并添加gitlab存储库
apt -y install curl vim openssh-server ca-certificates
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
3.安装gitlab社区版
1)通过源地址安装gitlab
apt-get install gitlab-ce
2)通过安装包安装gitlab
官方仓库地址:https://packages.gitlab.com/gitlab/gitlab-ce
RPM包:
rpm -ivh
deb包:
dpkg -i
4.重置root密码
[root@test bin]# gitlab-rails console irb(main):001:0> user = User.where(id:1).first => #<User id:1 @root> irb(main):002:0> user.password = '修改的密码(必须超过八位)' => "qwer1234" irb(main):003:0> user.password_confirmation = '修改的密码(必须超过八位)' => "qwer1234" irb(main):004:0> user.save Enqueued ActionMailer::DeliveryJob (Job ID: 4752a4a4-4e85-4e8b-9f27-72788abfe97c) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007f519e7501d8 @uri=#<URI::GID gid://gitlab/User/1>> => true irb(main):005:0> exit
5.编辑配置文件,设置为你的url
vim /etc/gitlab/gitlab.rb
external_url 'http://xxx'
#重新生成配置并启动服务
gitlab-ctl reconfigure
打开浏览器,输入你设置的url,用户名:root 密码:刚才重置的密码

浙公网安备 33010602011771号