1,依赖安装;
yum install curl policycoreutils openssh-server openssh-clients gcc gcc-c++ mysql-devel mariadb-server
2,安装gitlab-ce
rpm -ivh gitlab-ce-7.12.2~omnibus.1-1.x86_64.rpm
3,gitlab.rb配置
vim /etc/gitlab/gitlab.rb
external_url 'http://git.chayu.alp'
gitlab_rails['db_adapter'] = "mysql2"
gitlab_rails['db_encoding'] = "utf8"
gitlab_rails['db_database'] = "gitlab"
gitlab_rails['db_username'] = "gitlab"
gitlab_rails['db_password'] = "gitlab"
gitlab_rails['db_host'] = "192.168.40.220"
gitlab_rails['db_port'] = 3306
postgresql['enable'] = false
gitlab_ci['db_adapter'] = "mysql2"
编辑完之后运行 gitlab-ctl reconfigure
报错
4,关闭内置postgresql后使用mysql需要增加mysql2 自己创建myqsql 帐号以及database 等等;
cd /opt/gitlab/embedded/bin/
./gem install -i/opt/gitlab/embedded/service/gem/ruby/2.1.0/ mysql2 –v 0.3.16
5,更改mysql2配置为;
vim /opt/gitlab/embedded/service/gitlab-rails/Gemfile
6,启动;
gitlab-ctl reconfigure #编译
gitlab-ctl start #启动
会涉及到的命令:
gitlab-rake gitlab:check //检查gitlab
gitlab-rake setup //安装数据库
gitlab-ctl stop //关闭服务
gitlab-ctl start //启动服务
Ps:1,数据库需要创建相对应gitlab.rb文件中的用户名密码和数据库;
2,在编译之前使用gitlab-rake gitlab:check 检查是否编译通过;
3,编译通过后使用gitlab-rake setup 安装数据库;
4,gitlab对所需依赖有小版本需求此文章仅适用于gitlab-ce-7.12.2~omnibus.1-1.x86_64.rpm
(需要这个包请联系:1953323800)