gitlab(代码仓库)
Posted ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ0
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gitlab(代码仓库)相关的知识,希望对你有一定的参考价值。
文章目录
gitlab
gitlab的部署
下载gitlab的rpm包
wget https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-13.12.3-ce.0.el8.x86_64.rpm/download.rpm
安装依赖
[root@localhost ~]# dnf -y install policycoreutils-python-utils curl openssh-server openssh-clients postfix cronie git
关闭防火墙selinux、开启邮箱服务
[root@localhost ~]# systemctl enable postfix
[root@localhost ~]# systemctl start postfix
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
安装
[root@localhost ~]# rpm -ivh gitlab-ce-13.12.3-ce.0.el8.x86_64.rpm
warning: gitlab-ce-13.12.3-ce.0.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID f27eab47: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:gitlab-ce-13.12.3-ce.0.el8 ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \\
/ /_/ / / /_/ /___/ /_/ / /_/ /
\\____/_/\\__/_____/\\__,_/_.___/
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=13-12
修改配置文件
[root@localhost ~]# sed -i "s#^external_url 'http://gitlab.example.com'#external_url 'http://192.168.247.100'#g" /etc/gitlab/gitlab.rb
重新读取配置文件并重启gitlab
[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 3955) 0s
ok: run: gitaly: (pid 3972) 0s
ok: run: gitlab-exporter: (pid 3992) 0s
ok: run: gitlab-workhorse: (pid 3995) 0s
ok: run: grafana: (pid 4004) 0s
ok: run: logrotate: (pid 4016) 1s
ok: run: nginx: (pid 4028) 0s
ok: run: node-exporter: (pid 4036) 1s
ok: run: postgres-exporter: (pid 4042) 0s
ok: run: postgresql: (pid 4055) 0s
ok: run: prometheus: (pid 4064) 0s
ok: run: puma: (pid 4076) 0s
ok: run: redis: (pid 4081) 0s
ok: run: redis-exporter: (pid 4090) 1s
ok: run: sidekiq: (pid 4173) 0s
[root@localhost ~]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 13.12.3
[root@localhost ~]# ss -anlt
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 1024 127.0.0.1:9121 0.0.0.0:*
LISTEN 0 1024 127.0.0.1:9090 0.0.0.0:*
LISTEN 0 1024 127.0.0.1:9187 0.0.0.0:*
LISTEN 0 1024 127.0.0.1:9093 0.0.0.0:*
LISTEN 0 1024 127.0.0.1:9100 0.0.0.0:*
LISTEN 0 1024 127.0.0.1:9229 0.0.0.0:*
LISTEN 0 128 127.0.0.1:9168 0.0.0.0:*
LISTEN 0 511 0.0.0.0:80 0.0.0.0:*
LISTEN 0 1024 127.0.0.1:9236 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 1024 127.0.0.1:3000 0.0.0.0:*
LISTEN 0 100 127.0.0.1:25 0.0.0.0:*
LISTEN 0 511 0.0.0.0:8060 0.0.0.0:*
LISTEN 0 1024 *:9094 *:*
LISTEN 0 128 [::1]:9168 [::]:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 100 [::1]:25 [::]:*
修改密码
[root@localhost ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
GitLab: 13.12.3 (757327a59bc) FOSS
GitLab Shell: 13.18.0
PostgreSQL: 12.6
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.6)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = 'hanao19981203'
=> "hanao19981203"
irb(main):003:0> user.password_confirmation = 'hanao19981203'
=> "hanao19981203"
irb(main):004:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: b61a0675-4723-439d-9792-bc45ac01268a) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", :args=>[#<GlobalID:0x00007ff4a4f857a0 @uri=#<URI::GID gid://gitlab/User/1>>]
=> true
irb(main):005:0> exit
gitlab页面
以上是关于gitlab(代码仓库)的主要内容,如果未能解决你的问题,请参考以下文章