gitlab在持续化集成中非常的重要,它用于开发人员进行提交代码关于代码的库,本次安装还是使用vagrant的方式。源码:https://github.com/limingios/docker/tree/master/No.11
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version ">= 1.6.0"
boxes = [
{
:name => "gitlab",
:mem => "4096",
:cpu => "2"
}
]
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
boxes.each do |opts|
config.vm.define opts[:name] do |config|
config.vm.hostname = opts[:name]
config.vm.provider "vmware_fusion" do |v|
v.vmx["memsize"] = opts[:mem]
v.vmx["numvcpus"] = opts[:cpu]
end
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", opts[:mem]]
v.customize ["modifyvm", :id, "--cpus", opts[:cpu]]
end
config.vm.network :private_network, type: "dhcp"
end
end
config.vm.provision "shell", privileged: true, path: "./setup.sh"
end
#/bin/sh
sudo yum install -y yum upgrade
sudo yum install -y net-tools
sudo yum install -y curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install -y postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
sudo yum install -y java-1.8.0-openjdk.x86_64
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
#源码No.11的gitlab目录
vagrant up
新建 /etc/yum.repos.d/gitlab-ce.repo,内容为
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
sudo yum makecache
sudo yum install gitlab-ce
sudo gitlab-ctl reconfigure
ip a
#登录,修改root密码。并登录 用户名是root,密码是刚设置的
http://172.28.128.3
sudo vi /etc/gitlab/gitlab.rb
#上边的修改保存后,需要执行下面的命令才可以生效
sudo gitlab-ctl reconfigure
``` cmd gitlab-ctl restart ···
PS:gitlab安装基本就是这样也不是很复杂,主要是必须更改源,国内的墙太高太宽了。