Source code repository selection -gitlab

Common Code for the warehouse (SVN / GIT). Comprehensive comparison of GIT over SVN has a more powerful version control management, as well as more convenient pull branch, tagging, etc., choose to use gitlab-ce as the source code management repository.
OS (centos7)
version selection (gitlab-ce-12.2.4-ce.0.el7.x86_64 )
server IP: 10.10.10.10

Download rely package

Recommend downloading the installation package of domestic Tsinghua mirror sites https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.2.4-ce.0.el7.x86_64.rpm -P /tmp

Setup

#安装环境倚赖包
yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python patch git

#安装gitlab-ce
yum -y install /tmp/gitlab-ce-12.2.4-ce.0.el7.x86_64.rpm

Modify the configuration file

  • Backup the original configuration file
cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab.rb.bak
  • Configure the listener address or domain name
cat > /etc/gitlab/gitlab.rb << EOF
external_url='http://10.10.10.10'
EOF

This configuration takes effect in gitlab-nginx.

  • Configuring time zone
cat >> /etc/gitlab/gitlab.rb << EOF
gitlab_rails['time_zone'] = 'PRC'
EOF
  • Ssl encryption configured to send mail (part of the cloud server will block access to the external network port 25)
cat >> /etc/gitlab/gitlab.rb << EOF
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.test.com"           # 用户输入自己的smtp服务器地址,例如作者的时163 的企业服务地址
gitlab_rails['smtp_port'] = 465                        # 用户smtp 的端口号
gitlab_rails['smtp_user_name'] = "[email protected]"          # 用户的邮箱地址
gitlab_rails['smtp_password'] = "passwd"             # 用户的邮箱密码
gitlab_rails['smtp_domain'] = "test.com"                 # 用户邮箱的域名
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['gitlab_email_from'] = '[email protected]'       # 用户的邮箱地址
user['git_user_email'] = "[email protected]"                  # 用户的邮箱地址
gitlab_rails['smtp_tls'] = true                        # 打开 ssl 加密传输
EOF
  • Refresh Profile
gitlab-ctl reconfigure

Start Service

#启动邮件服务(发送邮件)
systemctl start postfix
systemctl enable postfix

#启动gitlab
gitlab-ctl start
  • View gitlab start state
gitlab-ctl status

Access http://10.10.10.10
enter the initial password (8-digit password above)

Username: root
Password: (password initial 8)

Guess you like

Origin www.cnblogs.com/taoyuxuan/p/11468817.html
Recommended