1、gitlab的安装及配置
安装包下载地址:https://packages.gitlab.com/gitlab/gitlab-ce rpm包国内下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/ ubuntu国内下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/ 官方安装文档:https://docs.gitlab.com/ce/install/
1.1、deb包安装gitlab及配置
root@gitlab-server:~# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/focal/main/g/gitlab-ce/gitlab-ce_15.7.0-ce.0_amd64.deb
root@gitlab-server:~# dpkg -i gitlab-ce_15.7.0-ce.0_amd64.deb
root@gitlab-server:~# vi /etc/gitlab/gitlab.rb
root@gitlab-server:~# grep ^[a-z] /etc/gitlab/gitlab.rb
external_url 'http://10.0.0.100'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "eternallywm@qq.com"
gitlab_rails['smtp_password'] = "kjhueaoywwpgecda"
gitlab_rails['smtp_domain'] = "qq.com"
gitlab_rails['smtp_authentication'] = :login
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = "eternallywm@qq.com"
gitlab_rails['git_user_email'] = "eternallywm@qq.com"
root@gitlab-server:~# gitlab-ctl reconfigure
1.2、验证gitlab启动完成并验证端口及状态
1.3、访问gitlab web界面并关闭默认的用户注册功能
默认情况下是可以直接注册账号的,因此需要关闭此功能。
1.4、deb包安装后的gitlab相关目录
/etc/gitlab #配置文件目录 /run/gitlab #运行的pid目录 /opt/gitlab #安装的目录 /var/opt/gitlab #数据目录 /var/log/gitlab #日志目录
1.5、常用的gitlab命令
gitlab-rails #用于启动控制台进行特殊操作,比如修改你管理员密码、打开数据库控制台(gitlab-rails dbconsole)等等 gitlab-psql #数据库命令行 gitlab-rake #数据备份恢复等数据操作 gitlab-ctl #客户端命令的操作行 gitlab-ctl stop #停止gitlab gitlab-ctl start #启动gitlab gitlab-ctl restart #重启gitlab gitlab-ctl status #查看组件运行状态 gitlab-ctl tail nginx #查看某个组件的日志