码迷,mamicode.com
首页 > 其他好文 > 详细

搭建gitlab

时间:2015-07-03 00:24:58      阅读:388      评论:0      收藏:0      [点我收藏+]

标签:gitlab搭建   以及gitolite迁移到 gitlab   

环境Ubuntu 12.04


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 orconfigure a custom SMTP server. If you wish to use Exim, please configure it as an SMTP server.

On Centos 6 and 7, the commands below will also open HTTP and SSH access in the system firewall.

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



2. 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

If you are not comfortable installing the repository through a piped script, you can find the entire script here.



3. Configure and start GitLab

sudo gitlab-ctl reconfigure



4. Browse to the hostname and login

Username: root 
Password: 5iveL!fe

到此可以使用root账户登录,新建项目。



下面配置一下邮件:

 gitlab_rails[‘gitlab_email_from‘] = ‘j@example.com‘
 
 gitlab_rails[‘smtp_enable‘] = true
 gitlab_rails[‘smtp_address‘] = "smtp.exmail.qq.com"
 gitlab_rails[‘smtp_port‘] = 456
 gitlab_rails[‘smtp_user_name‘] = "j@example.com"
 gitlab_rails[‘smtp_password‘] = "password"
 gitlab_rails[‘smtp_domain‘] = "smtp.qq.com"
 gitlab_rails[‘smtp_authentication‘] = "login"
 gitlab_rails[‘smtp_enable_starttls_auto‘] = true


配置完邮件以后就可以注册用户了。


如果想要把之前使用的gitolite的项目导入到gitlab使用以下方式(注意:之前的仓库是没有.git后缀的,但是gitlab是有.git后缀的,我们要手动把仓库名字改成带.git的格式)

cp /tmp/repositories/* /var/opt/gitlab/git-data/repositories/root/*
cd /var/opt/gitlab/git-data/repositories/root/
mv example example.git
chown -R git:git /var/opt/gitlab/git-data/repositories/root/*

#执行以下命令导入
gitlab-rake gitlab:import:repos

出现如下图说明导入完成,登录gitlab去查看吧。

Processing hortor/goose_client.git

 * Created goose_client (hortor/goose_client.git)

Done!



搭建gitlab

标签:gitlab搭建   以及gitolite迁移到 gitlab   

原文地址:http://crazyjjx.blog.51cto.com/2746212/1670323

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!