搭建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账户登录,新建项目。



下面配置一下邮件:

 vim /etc/gitlab/gitlab.rb 
 
 gitlab_rails['gitlab_email_from'] = '[email protected]'
 gitlab_rails['smtp_enable'] = true
 gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
 gitlab_rails['smtp_port'] = 456
 gitlab_rails['smtp_user_name'] = "[email protected]"
 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 root/client.git

 * Created goose_client (root/client.git)

Done!



你可能感兴趣的:(gitlab,gitlab搭建,以及gitolite迁移到)