gitlab 安装和配置原创
# gitlab 安装和配置
# 一、gitlab安装
# 配置环境
sudo apt-get update
sudo apt-get install curl gnupg apt-transport-https
curl -L https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey | sudo apt-key add -
1
2
3
2
3
vim /etc/apt/sources.list.d/gitlab_gitlab-ce.list
#添加下面两行,focal对应ubuntu20.04
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu focal main
deb-src https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu focal main
1
2
3
4
2
3
4
# 安装gitlab
sudo EXTERNAL_URL="http://111.96.8.19:8090" apt-get install gitlab-ce
1
此时访问http://111.96.8.19:8090
,就能看见gitlab登录页
- 默认用户名和密码
#用户名
root
#初始密码,登陆后更改密码
cat /etc/gitlab/initial_root_password
1
2
3
4
2
3
4
# 二、gitlab邮箱配置
# 编辑配置文件
sudo vim /etc/gitlab/gitlab.rb
1
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "xxx@163.com"
gitlab_rails['smtp_password'] = "UUWELKIHJHYGIWVP"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_pool'] = false
gitlab_rails['gitlab_email_from'] = 'xxx@163.com'
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# gitlab重新加载
gitlab-ctl reconfigure
1
# 打开gitlab控制台
gitlab-rails console
1
测试一下是否能发送邮件
Notify.test_email('anothermail@163.com','gitlab','test').deliver_now
1
编辑 (opens new window)
上次更新: 2022/10/03, 09:24:26
- 01
- Linux系统移植(五)--- 制作、烧录镜像并启动Linux02-05
- 03
- Linux系统移植(三)--- Linux kernel移植02-05