一、概述
GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务。
特性
1、免费,可以免费建立私有仓库(GitHub私有仓库需要收费)
2、工单、工单看板
3、工作流
二、安装
1、安装环境
注:参考官方提供的安装教程,在CentOS 7使用rpm文件安装过程中出现以下错误,且无法找到解决方法。
gitlab.rpm文件安装过程提示error: unpacking of archive failed on file
以下是基于Ubuntu 16.04安装的说明,使用aws提供的镜像,使用t2.medium实例,CPU 2核,内存4GB。
2、安装步骤
(1)添加必要的依赖
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates
(2)安装 Postfix用于发送邮件
sudo apt-get install -y postfix
(3)下载安装GitLab package
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" apt-get install gitlab-ee
(4)配置GitLab
sudo gitlab-ctl reconfigure
(5)启动
sudo gitlab-ctl start
参考链接
https://about.gitlab.com/installation/#ubuntu
https://segmentfault.com/a/1190000008291730
3、修改端口
默认端口为80端口
修改下面3个文件,可以很容易看到端口修改的地方
vi /opt/gitlab/embedded/conf/nginx.conf
vi /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
vi /var/opt/gitlab/nginx/conf/gitlab-http.conf
#重启服务
gitlab-ctl restart
4、修改域名(用于对外提供HTTP服务,项目被用于clone等操作的地址)
vi /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
#重启服务
gitlab-ctl restart
三、使用
1、首次使用
默认用户是root,通过ip加端口访问,会跳转到需要修改密码的界面
http://ec2-52-83-32-232.cn-northwest-1.compute.amazonaws.com.cn:8081/
登录后