李明
|
创建虚拟机
# -*- 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/shsudo 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
更改安装源
[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
关机后,重启gitlab的命令gitlab-ctl restart PS:gitlab安装基本就是这样也不是很复杂,主要是必须更改源,国内的墙太高太宽了。
|
2018-10-26 00:27:18