Ubuntu12.04安装gitlab社区版(Install a GitLab CE Omnibus package on ubuntu12.04)

Ubuntu 16.04.1 安装gitlab 8.10.7-ce.0
GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务。

特点:1. Web框架使用Ruby on Rails。 2. 基于MIT代码发布协议。 3. 需要gitolite协同工作。

1.安装和配置依赖包( Install and configure the necessary dependencies)

If you install Postfix to send email please select ‘Internet Site’ during setup. Instead of using Postfix you can also use Sendmail or configure a custom SMTP server. If you wish to use Exim, please configure it as an SMTP server.

sudo apt-get install curl openssh-server ca-certificates postfix

2. 增加gitlab安装源,并安装 gitlab-ce(Add the GitLab package server and install the package)

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce

Centos快速安装脚本:
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

快速安装脚本:https://packages.gitlab.com/gitlab/gitlab-ce/install

手动下载安装地址:https://packages.gitlab.com/gitlab/gitlab-ce

dpkg -i gitlab-ce-XXX.deb

源是加上了,但是下载也太慢了。

改手动下载安装:

2

还是很慢,尝试换迅雷,速度也不理想,想到离线下载,还是网盘的离线功能给力:offline download
dpkg -i gitlab-ce_8.1.2-ce.0_amd64.deb
root@ganl-virtual-machine:~# dpkg -i gitlab-ce_8.1.2-ce.0_amd64.deb
Selecting previously unselected package gitlab-ce.
(正在读取数据库 ... 系统当前共安装有 212515 个文件和目录。)
正在解压缩 gitlab-ce (从 gitlab-ce_8.1.2-ce.0_amd64.deb) ...
正在设置 gitlab-ce (8.1.2-ce.0) ...
gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:

sudo gitlab-ctl reconfigure

gitlab: GitLab should be reachable at http://ganl-virtual-machine
gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab:
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab:
It looks like GitLab has not been configured yet; skipping the upgrade script.

3. 配置和使用(Configure and start GitLab)

sudo gitlab-ctl reconfigure

Recipe: gitlab::logrotate
* ruby_block[reload logrotate svlogd configuration] action create
- execute the ruby block reload logrotate svlogd configuration

Running handlers:
Running handlers complete
Chef Client finished, 94/216 resources updated in 41.887080499 seconds
gitlab Reconfigured!
root@ganl-virtual-machine:~#

4.访问看下效果( Browse to the hostname and login)

Username: root
Password: 5iveL!fe

4

算是装好了,过程比较简单。

5

邮箱配置:
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/smtp.md
vi /etc/gitlab/gitlab.rb

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "xxxx@xx.com"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_ssl'] = true
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false

gitlab_rails['gitlab_email_from'] = 'xxxx@xx.com'
gitlab_rails['gitlab_email_reply_to'] = 'xxxx@xx.com'

gitlab_rails[‘gitlab_email_from’] = ‘xxxx@xx.com’
gitlab_rails[‘gitlab_email_reply_to’] = ‘xxxx@xx.com’

需要设置,不然会报错,腾讯邮箱发不出去:
Net::SMTPSyntaxError: 501 mail from address must be same as authorization user
当ip变化或者换成域名,需要修改gitlab地址,也是编辑 /etc/gitlab/gitlab.rb
external_url ‘http://code.xxx.com’
更换gravatar头像地址,国内:
gitlab_rails[‘gravatar_plain_url’] = ‘http://gravatar.duoshuo.com/avatar/%{hash}?s=%{size}&d=identicon’

修改完,需要执行
gitlab-ctl reconfigure

gitlab-ctl tail 可以看动态日志

网上多数修改gitlab.yml,config.yml应该都是针对gitlab7以前的版本,>=7 :vi /etc/gitlab/gitlab.rb;gitlab-ctl reconfigure

未经允许不得转载:ganlei的个人博客 » Ubuntu12.04安装gitlab社区版(Install a GitLab CE Omnibus package on ubuntu12.04)

赞 (3)
分享到:更多 ()