gitlab warehouse deployment

Gitlab many companies self-built warehouse for source code management, and then combined jenkins tool automatically compiled code package, deploy projects that automate water.

1. Download the latest version gitlab, installation by rpm way

gitlab Download: https://packages.gitlab.com/gitlab/gitlab-ce/
installation environment initialization
yum install curl policycoreutils openssh-server openssh -clients postfix -y
default, use Postfix to send mail

Start postfix Service
chkconfig postfix ON
systemctl STOP firewalld
systemctl disable firewalld
installation gitlab-ce
configure and start gitlab
gitlab-ctl reconfigure # reconfiguring the application. Equivalent to initialize it
gitlab-ctl Status
gitlab default port is 8090, if the port is occupied, you can modify the port number
vim /etc/gitlab/gitlab.rb
external_url ' HTTP: // ip: 8899 '
Unicorn [ 'Port'] = 8899
-i Sed '13s of # HTTP: //gitlab.example.com#http: //192.168.217.30: 8899 #' /etc/gitlab/gitlab.rb
change: 13 is external_url ' http://gitlab.example.com '
is: 13 is external_url ' http://192.168.217.30:8899 '
Add unicorn [ 'port'] = 8899 , prevent port conflicts

Close gitlab: # gitlab-ctl stop
start gitlab: # gitlab-ctl start
restart gitlab: # gitlab-ctl restart

2. container deployment

安装docker:
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl start docker
systemctl enable docker
docker pull gitlab/gitlab-ce
mkdir -p /data/docker/gitlab/{config,data,logs}

启动容器
docker run -itd --name gitlab --hostname gitlab \
--restart always -p 4443:443 -p 8888:80 -p 2222:22 \
-v /data/docker/gitlab/config:/etc/gitlab \
-v /data/docker/gitlab/data:/var/opt/gitlab \
-v /data/docker/gitlab/logs:/var/log/gitlab \
gitlab/gitlab-ce:latest
访问 本机IP地址:8888

Guess you like

Origin blog.51cto.com/tuwei/2417590