赞
踩
● github(国外的,很卡)或者gitee(国内的,网速还可以,可以设置项目为私有,防止其他人可见)
● 通过gitlab搭建自己的git服务器
● gitlab十分吃内存,建议内存至少4G起步,以便遇到各种各样的坑
社长自己部署的这台服务器只部署了gitlab+jenkins,给大家看看服务器的开销
yum -q list openssh-server
如果没有安装可使用如下命令安装
yum -y install oepnssh-server
检查系统是否启动OpenSSH服务器
systemctl status sshd
如果OpenSSH服务器没有启动,则手动启动
systemctl start sshd
[CentOS7]设置sshd开机自动启动
systemctl enable sshd
如果设置sshd启动后,sshd状态仍没有启动,检查防火墙是否阻止了ssh服务
firewall-cmd --list-service
1、启动FirewallD服务命令:
systemctl start firewalld.service #开启服务
systemctl enable firewalld.service #设置开机启动
2、查看FirewallD防火墙状态:
systemctl status firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
# 安装发送邮件功能的postfix
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
gilab离线15.10安装包
编译
● 下载xshell或者MobaItem 远程连接工具,把下载后的文件上传到服务器
rpm -ivh gitlab-ce-12.6.3-ce.0.el7.x86_64.rpm --nodeps --force
● --nodeps --force参数是为了忽略某些报错,不然会提示秘钥问题
### 项目访问的地址 47.XXX.XXX.XX是服务器地址 8888是端口
external_url 'http://47.XXX.XXX.XX:8888'
###oracle的相关配置
postgresql['shared_buffers'] = "64MB"
postgresql['max_worker_processes'] = 1
postgresql['shared_buffers'] = "64MB"
sidekiq['concurrency'] = 1
puma['worker_processes'] = 1
###修改端口
puma['port'] = 8081
#unicorn['worker_processes'] = 1
nginx['worker_processes'] = 2
#puma['worker_timeout'] = 10
#实时打印puma包的日志
sudo gitlab-ctl tail puma
坑点1: 会默认使用8080端口,导致软件死循环,cpu狂飙
puma['port'] = 8081
/opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:525:in `handle_argument_error': ERROR: "rails console" was called with arguments ["production"] (Thor::InvocationError)
Usage: "rails console [options]"
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:34:in `rescue in run'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:20:in `run'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/railties-6.1.7.2/lib/rails/command/base.rb:69:in `perform'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/railties-6.1.7.2/lib/rails/command.rb:48:in `invoke'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/railties-6.1.7.2/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
/opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/railties-6.1.7.2/lib/rails/commands/console/console_command.rb:95:in `perform': wrong number of arguments (given 1, expected 0) (ArgumentError)
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/railties-6.1.7.2/lib/rails/command/base.rb:69:in `perform'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/railties-6.1.7.2/lib/rails/command.rb:48:in `invoke'
from /opt/gitlab/embedded/lib/ruby/gems/3.0.0/gems/railties-6.1.7.2/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
###登录控制台命令
gitlab-rails console -e production
##查看root用户
User.where(username:"root").first
### 修改密码,注意字符+数字+特殊符号,不然提醒账号密码太简单
user.password = "Test@1234"
### 保存密码
user.save!
### 退出
quit
gitlab-ctl reconfigure
gitlab-ctl reconfigure ###修改配置后重启
gitlab-ctl restart ###重启服务
点击右上角头像,prefenrecess->选择中文简写
既然搭建gitlab服务器,大部分用户的场景代码都是不对外开源的。所以我们需要关闭git注册接口
gitlab相关使用还未完,后续会迭代更新gitlab相关使用的教程
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。