Ubuntu Server 22.04.1安装Gitlab

DevOps Ubuntu评论479字数 2289阅读7分37秒阅读模式

Gitlab是一个利用Ruby on Rails开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人的项目 Gitlab拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,他非常易于浏览提交过的版本并提供一个文件历史库。他还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。

安装

信任gitlab的GPG密钥

root@i-yky53s1k:~# curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

配置源

root@i-yky53s1k:~# vim /etc/apt/sources.list.d/gitlab-ce.list
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu jammy main

安装gitlab

root@i-yky53s1k:~# apt update
root@i-yky53s1k:~# apt install gitlab-ce

Ubuntu Server 22.04.1安装Gitlab

修改gitlab配置

root@i-219jlmsg:~# vim /etc/gitlab/gitlab.rb
external_url 'http://gitlab.centoscn.vip'
gitlab_rails['backup_path'] = "/opt/gitlab/backups"
gitlab_rails['backup_keep_time'] = 604800
root@i-219jlmsg:~# gitlab-ctl reconfigure

查看gitlab状态

root@i-219jlmsg:~# gitlab-ctl status
run: alertmanager: (pid 17794) 175s; run: log: (pid 17556) 205s
run: gitaly: (pid 17754) 178s; run: log: (pid 16936) 315s
run: gitlab-exporter: (pid 17768) 177s; run: log: (pid 17461) 226s
run: gitlab-kas: (pid 17168) 304s; run: log: (pid 17178) 303s
run: gitlab-workhorse: (pid 17738) 179s; run: log: (pid 17370) 240s
run: logrotate: (pid 16848) 328s; run: log: (pid 16856) 327s
run: nginx: (pid 17749) 178s; run: log: (pid 17400) 236s
run: node-exporter: (pid 17762) 178s; run: log: (pid 17450) 230s
run: postgres-exporter: (pid 17803) 175s; run: log: (pid 17639) 200s
run: postgresql: (pid 16989) 310s; run: log: (pid 17010) 309s
run: prometheus: (pid 17779) 176s; run: log: (pid 17529) 212s
run: puma: (pid 17285) 253s; run: log: (pid 17303) 250s
run: redis: (pid 16883) 322s; run: log: (pid 16892) 321s
run: redis-exporter: (pid 17771) 177s; run: log: (pid 17504) 218s
run: sidekiq: (pid 17316) 247s; run: log: (pid 17337) 244s

访问gitlab

  • url http://gitlab.centoscn.vip/

Ubuntu Server 22.04.1安装Gitlab

  • 查看初始密码
root@i-219jlmsg:~# cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: KKNLDhOdpoF+DQJjM3y4780FmwSebO6nC3aWA4Z8JZM=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
root@i-219jlmsg:~# 

登录

Ubuntu Server 22.04.1安装Gitlab

继续阅读
Ubuntu最后更新:2024-7-5
DevOps
  • 本文由 发表于 2024年7月4日 16:23:11
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
Git仓库迁移 GitLab

Git仓库迁移

一、简述 为简化管理与维护流程,我们将进行Git仓库迁移,由GitHub转移至自建GitLab平台。本次迁移无需您手动转移代码至GitLab,仅需在下班前,确保将本地所有代码更新同步至GitHu...
Gitlab配置HTTPS GitLab

Gitlab配置HTTPS

简述 gitlab最新是开启https会自动配置,但只有三个月有效期,使用自己设的加密证书应设置。 配置 [root@iZ8vb3ycs3gfmlbmyxy6efZ ~]# vim /etc/g...
评论  0  访客  0

发表评论