Home | 简体中文 | 繁体中文 | 杂文 | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | Github | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | 打赏(Donations) | About
知乎专栏多维度架构

1.11. FAQ

1.11.1. 查看日志

				
gitlab-ctl tail
gitlab-ctl tail gitlab-rails
gitlab-ctl tail nginx/gitlab_error.log				
				
			

1.11.2. debug runner

				
gitlab-runner -debug run				
				
			

1.11.3. gitolite 向 gitlab 迁移

早期gitlab使用gitolite为用户提供SSH服务,新版gitlab有了更好的解决方案gitlab-shell。安装新版本是必会涉及gitolite 向 gitlab 迁移,下面是我总结的一些迁移经验。

第一步,将gitolite复制到gitlab仓库目录下

# cp -r /gitroot/gitolite/repositories/* /var/opt/gitlab/git-data/repositories/
			

执行导入处理程序

# gitlab-rake gitlab:import:repos
			

上面程序会处理一下目录结构,例如

进入gitlab web界面,创建仓库与导入的仓库同名,这样就完成了导入工作。

[提示]提示

转换最好在git用户下面操作,否则你需要运行

# chown git:git -R /var/opt/gitlab/git-data/repositories				
				

1.11.4. 修改主机名

默认Gitlab采用主机名,给我使用代理一定麻烦

git@hostname:example.com/www.example.com.git
http://hostname/example.com/www.example.com.git
			

我们希望使用IP地址替代主机名

git@172.16.0.1:example.com/www.example.com.git
http://172.16.0.1/example.com/www.example.com.git
			

编辑 /etc/gitlab/gitlab.rb 配置文件

external_url 'http://172.16.0.1'
			

重新启动Gitlab

# gitlab-ctl reconfigure
# gitlab-ctl restart
			

1.11.5. ERROR: Uploading artifacts as "archive" to coordinator... too large archive

持续集成提示错误

			
ERROR: Uploading artifacts as "archive" to coordinator... too large archive  id=185 responseStatus=413 Request Entity Too Large status=413 token=HKerPDE6
FATAL: too large                                   
ERROR: Job failed: exit status 1			
			
			

解决方案

Admin - Settings - CI/CD - Continuous Integration and Deployment

点击 Expand 展开配置项

Maximum artifacts size (MB): 修改构建无最大尺寸