`

[CI Architect] gitolite3的安装与配置

    博客分类:
  • CI
阅读更多

版本控制管理是持续集成(CI)中一个重要的环节。时下,最流行的SCM当属GIT。在GIT服务器中,gitolite是一个小巧而易用的服务器。相比github,它并不强大,但企业内部做CI,绝对胜任。

本文介绍gitolite最新版本3.3的安装和配置。

gitolite是perl开发的git server 地址为:https://github.com/sitaramc/gitolite。

 

GITolite服务器信息

主机名:meridians-gitolite

IP:192.168.0.140

系统:Ubuntu 12.10

 

另有一台客户端,这里是hanl@hanl-ubuntu1204

1.SSH设置

1.1.[server:meridians-gitolite]安装openssh-server

sudo apt-get install openssh-server

 

1.2.[client:hanl-ubuntu1204]测试连接

eric@meridians-jenkins-master:~$ ssh eric@192.168.0.140

The authenticity of host '192.168.0.140 (192.168.0.140)' can't be established.

ECDSA key fingerprint is e3:28:c5:b0:82:da:47:2f:34:30:bd:11:95:22:4f:4d.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.0.140' (ECDSA) to the list of known hosts.

eric@192.168.0.140's password:

Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-17-generic x86_64)

 

* Documentation:  https://help.ubuntu.com/

Last login: Sat Feb  2 05:43:10 2013 from 192.168.0.102

eric@meridians-gitolite:~$ exit

 

本文原创地址:http://feuyeux.iteye.com/blog/1797261

2.登录git server

hanl@hanl-ubuntu1204:~$ ssh eric@192.168.0.140

 

2.1.安装GIT

sudo apt-get install git

git config --global user.name "Eric Han"

git config --global user.email  "feuyeux@gmail.com"

 

(2.2.GIT代理 如果企业内部设置了代理服务器,GIT使用的端口会被封杀,需要走代理)

2.2.1.安装

sudo apt-get install socat

2.2.2.创建socat脚本

cd /home/git

sudo nano git-proxy.sh

#!/bin/bash

socat STDIO PROXY:10.11.70.71:$1:$2,proxyport=80

sudo chmod 777 git-proxy.sh

2.2.3.配置git代理

sudo nano /etc/profile

export GIT_PROXY_COMMAND=/home/git/git-proxy.sh

source /etc/profile

 

2.3.创建用户git

sudo adduser git

 

2.4.使用git身份

su git

cd ~

 

2.5.安装gitolite

git clone git://github.com/sitaramc/gitolite

mkdir -p ~/bin

gitolite/install -to ~/bin

nano .bashrc

PATH=/home/git/bin:$PATH

ctrl+o ctrl+x

source .bashrc

 

2.6.测试

gitolite help

hello, this is gitolite3 v3.3-10-g293df79 on git 1.7.9.5

 

2.7.退出git帐号 退出SSH登录

exit

exit

本文原创地址:http://feuyeux.iteye.com/blog/1797261

3.SSH证书

3.1.生成公私钥

hanl@hanl-ubuntu1204:~$ ssh-keygen -f ~/.ssh/han

 

3.2.拷贝证书到git server

sudo scp ~/.ssh/han.pub git@192.168.0.140:/tmp/han.pub

 

3.3.安装证书到gitolite

ssh git@192.168.0.140

gitolite setup -pk /tmp/han.pub

Initialized empty Git repository in /home/git/repositories/gitolite-admin.git/

Initialized empty Git repository in /home/git/repositories/testing.git/

WARNING: /home/git/.ssh/authorized_keys missing; creating a new one

 

3.4.退出SSH登录

exit

本文原创地址:http://feuyeux.iteye.com/blog/1797261

4.配置SSH无密码登录

hanl@hanl-ubuntu1204:~$ sudo nano ~/.ssh/config

# gitolite server

host gito

user git

hostname 192.168.0.140

port 22

IdentityFile ~/.ssh/han

本文原创地址:http://feuyeux.iteye.com/blog/1797261 

5.克隆GITolite管理

hanl@hanl-ubuntu1204:~$ git clone gito:gitolite-admin.git

Cloning into 'gitolite-admin'...

remote: Counting objects: 6, done.

remote: Compressing objects: 100% (4/4), done.

remote: Total 6 (delta 0), reused 0 (delta 0)

Receiving objects: 100% (6/6), done.

 

hanl@hanl-ubuntu1204:~$ cat gitolite-admin/conf/gitolite.conf

repo gitolite-admin

   RW+     =   han

repo testing

   RW+     =   @all

本文原创地址:http://feuyeux.iteye.com/blog/1797261

6.管理GIT项目

6.1编辑

hanl@hanl-ubuntu1204:~$ nano gitolite-admin/conf/gitolite.conf

repo gitolite-admin

   RW+     =   han

repo testing

   RW+     =   @all

repo airfactory

RW+=@all

6.2.提交

hanl@hanl-ubuntu1204:~$ cd gitolite-admin/

git commit -a -m "add airfactory repo"

git push

 

6.3.验证

ssh git@192.168.0.140

git@utfteam-virtual-machine:~$ ls repositories/

airfactory.git  gitolite-admin.git  testing.git

exit

6.4.检出

hanl@hanl-ubuntu1204:~$ git clone gito:airfactory

Cloning into 'airfactory'...

warning: You appear to have cloned an empty repository.

本文原创地址:http://feuyeux.iteye.com/blog/1797261

7.安装gitweb

sudo apt-get install highlight gitweb

The following extra packages will be installed:

 apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common highlight-common libapr1 libaprutil1

 libaprutil1-dbd-sqlite3 libaprutil1-ldap

Suggested packages:

 apache2-doc apache2-suexec apache2-suexec-custom httpd-cgi libcgi-fast-perl git-doc

The following NEW packages will be installed:

 apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common gitweb highlight highlight-common

 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap

0 upgraded, 12 newly installed, 0 to remove and 210 not upgraded.

Need to get 2,371 kB of archives.

 

sudo nano /etc/apache2/apache2.conf

append:

ServerName 127.0.0.1

sudo /etc/init.d/apache2 restart

 

sudo nano /etc/gitweb.conf

append:

$feature{'highlight'}{'default'} = [1];

 

sudo usermod -a -G git www-data

sudo chmod g+r /home/git/projects.list

sudo chmod -R g+rx /home/git/repositories

sudo service apache2 restart

 

/etc/gitweb.conf
$projectroot = "/home/git";

chmod755 /home/git

home/git/.gitolite.rc
umask 0000

chmod -R 777 /home/git/repositories
chmod 755 /home/git/projectlist

 

http://192.168.0.140/gitweb/

 

nano gitolite-admin/conf/gitolite.conf

append:

repo gitweb

   RW+     =   @all

hanl@hanl-ubuntu1204:~/gitolite-admin$ git commit -a -m "add gitweb repo"

git push

 

更多敏捷研究,请关注:https://github.com/feuyeux/meridians

 

本文原创地址:http://feuyeux.iteye.com/blog/1797261

0
1
分享到:
评论

相关推荐

    Rational Software Architect 9安装

    Rational Software Architect 9 安装指南 Rational Software Architect 9(简称 RSA9)是一款功能强大的软件架构设计工具,由 IBM 公司开发。为了帮助用户更好地安装和使用 RSA9,本文将提供详细的安装指南和相关...

    Rational Software Architect RSA 9.0 安装Android SDK ADT补丁

    Rational Software Architect RSA 9.0 安装Android SDK ADT时,出错,不能下载。这是补丁,覆盖掉IBMIMShared下面这2个目录里的文件,注意:需要带目录覆盖

    EnterpriseArchitect.12 安装版带注册key

    Enterprise Architect是以目标为导向的软件系统。它覆盖了系统开发的整个周期,除了开发类模型之外,还包括事务进程分析,使用案例需求,动态模型,组件和布局,系统管理,非功能需求,用户界面设计,测试和维护等。...

    Sencha Architect 3 注册码

    Sencha Architect 3 注册码Sencha Architect 3 注册码Sencha Architect 3 注册码Sencha Architect 3 注册码Sencha Architect 3 注册码Sencha Architect 3 注册码

    Architect3D2017(3D建筑师)v19官方安装中文版

    Architect 3D 2017简称3D建筑师,是一款非常好用且功能强大的专业3D图形制作软件,软件提供了丰富实用的功能,可以用于各类建筑制图、室内设计制图的制作,内置了丰富的方案供用户选择,同时还提供了一个向导来供...

    SIMATIC Visualization Architect系统手册

    SIMATIC Visualization Architect系统提供了详细的自述文件,包括系统的安装、配置、使用等方面的信息。用户可以通过自述文件来了解系统的使用和配置方法。 法律资讯警告提示 SIMATIC Visualization Architect系统...

    SenchaArchitect 3(5-3)

    SenchaArchitect 3(5-3)

    Enterprise Architect 8.0.858 汉化补丁包

    3. **安装过程**:按照补丁包的指示进行操作,通常需要关闭正在运行的Enterprise Architect程序,然后运行汉化.exe文件,按照提示完成安装。 4. **效果验证**:安装完成后,启动Enterprise Architect检查是否成功...

    uml软件->EA(Enterprise Architect)安装和使用

    1. **下载安装包**: 首先,你需要从Sparx Systems的官方网站或者授权的下载站点获取Enterprise Architect的安装文件,通常为.exe格式。 2. **运行安装程序**: 双击下载的.exe文件启动安装向导,按照提示进行操作。...

    enterprise architect 12(含注册码和中文包)

    本文将深入探讨"Enterprise Architect 12"的主要特性、功能以及如何安装和配置中文包。 一、Enterprise Architect 12概述 Enterprise Architect 12 是该系列的最新版本,它提供了一整套强大的建模、设计和管理工具...

    SenchaArchitect3

    在使用这个绿色版时,用户应确保所有必要的依赖项,如Java运行时环境(JRE),都已安装并配置好。同时,由于是便携式版本,所有设置和项目文件都将保存在应用程序目录下,方便携带和备份。 在开发过程中,开发者...

    EnterpriseArchitect 2016

    - **模板和配置**:Enterprise Architect支持自定义模板和配置,以适应不同项目的特定需求,同时保持模型的标准化。 - **高级分析与设计**:利用UML 2.0的特性,如泛型和包导入,可以进行更深入的分析和设计,提高...

    rational software architect licensen

    3. 安装和配置RSA许可证: 在安装RSA时,用户需要提供相应的许可证文件(.lic格式)。该文件包含了许可证密钥和服务器信息,可以通过IBM Passport Advantage或者直接从IBM官方网站获取。在安装过程中,用户需指定...

    IBM® Rational® Software Architect 安装说明

    ### IBM® Rational® Software Architect 安装说明:深入解析与操作指南 #### 一、IBM Rational Software Architect概览 IBM Rational Software Architect(简称RSA)是一款先进的建模工具,旨在帮助软件开发团队...

    Sencha Architect2.2.2入门操作图解教程

    除了基本的布局和组件配置,Sencha Architect还支持更高级的功能,如数据绑定、表单验证和远程数据源连接。对于数据驱动的应用,你可以设置模型(Model)、存储(Store)和网格(Grid),实现数据的加载、编辑和保存...

    Enterprise Architect 破解版

    Enterprise Architect 破解版 Enterprise Architect 破解版 Enterprise Architect 破解版 Enterprise Architect 破解版

    Enterprise Architect 7.5 汉化工具

    Enterprise Architect V7.5 汉化工具 安装玩Enterprise Architect 7.5后直接安装该工具,即可实现汉化! 该文件是exe文件

    EnterpriseArchitect汉化版(绝对可用)

    前者可能包含了下载、安装和配置的步骤,后者则可能详细解释了汉化的过程和注意事项,帮助用户顺利进行操作。 综上所述,这个汉化版的Enterprise Architect提供了一个中文友好环境,使得UML建模工作更加高效。通过...

    Enterprise Architect 中文用户手册

    Sparx Systems 的Enterprise Architect 是一个完整生命周期的UML 工具: · 设计和建造一个广泛的软件系统 · 业务分析,业务流程建模,管理要求 · 系统建模,系统架构建模,组件设计,仿真 · 广义域特定...

Global site tag (gtag.js) - Google Analytics