本文共 2181 字,大约阅读时间需要 7 分钟。
原创文章,欢迎转载。转载请注明:转载自,谢谢!
原文链接地址:gitlab在持续化集成中非常的重要,它用于开发人员进行提交代码关于代码的库,本次安装还是使用vagrant的方式。源码:
# -*- 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-toolssudo yum install -y curl policycoreutils openssh-server openssh-clientssudo systemctl enable sshdsudo systemctl start sshdsudo yum install -y postfixsudo systemctl enable postfixsudo systemctl start postfixsudo firewall-cmd --permanent --add-service=httpsudo systemctl reload firewalldsudo yum install -y java-1.8.0-openjdk.x86_64
curl -sS | sudo bash
![](https://upload-images.jianshu.io/upload_images/11223715-e0a8e65cf1af2320.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)### 执行命令创建``` cmd#源码No.11的gitlab目录vagrant up
新建 /etc/yum.repos.d/gitlab-ce.repo,内容为
[gitlab-ce]name=Gitlab CE Repositorybaseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/gpgcheck=0enabled=1
sudo yum makecachesudo 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
gitlab-ctl restart ···PS:gitlab安装基本就是这样也不是很复杂,主要是必须更改源,国内的墙太高太宽了。![](http://upload-images.jianshu.io/upload_images/11223715-3407e1c7ac8d7935?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
转载于:https://blog.51cto.com/12040702/2299529