本地服务器安装 GITLAB 服务

安装

安装依赖

> sudo apt-get install -y curl openssh-server ca-certificates

安装邮件系统

> sudo apt-get install -y postfix

安装gitlab

> curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash

配置gitlab URL

> sudo EXTERNAL_URL="http://192.168.71.175" apt-get install gitlab-ee

安装邮件

编辑配置文件

> sudo vim /etc/gitlab/gitlab.rb

写入如下配置:

# gitlab email
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = '[email protected]'
gitlab_rails['gitlab_email_display_name'] = 'CCNU GITLAB'
gitlab_rails['gitlab_email_reply_to'] = '[email protected]'
gitlab_rails['gitlab_default_can_create_group'] = true
gitlab_rails['gitlab_username_changing_enabled'] = true
gitlab_rails['gitlab_default_theme'] = 2

# smtp
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp-mail.outlook.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "ccnu"
gitlab_rails['smtp_domain'] = "smtp-mail.outlook.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'

重启配置

> sudo gitlab-ctl reconfigure

测试

> sudo gitlab-rails console

irb(main):001:0> Notify.test_email('[email protected]', 'Message Subject', 'Message Body').deliver_now

你可能感兴趣的:(Linux)