CVS 配置方法,及实时同步到真实代码 (实时发布)

kill -9 `ps aux|grep commitlog|awk ‘{print $2}’`
建立帐号
#groupadd cvs
#useradd  cvsroot -g cvs
检查是否存在cvs端口服务,防火墙需要打开2401的权限。
#more /etc/services | grep cvspserver
看看是否有:
cvspserver  2401/tcp #CVS client/server operations
cvspserver  2401/udp #CVS client/server operations
#vi /etc/xinetd.d/cvspserver
service cvspserver
{
disable = no
flags           = REUSE
socket_type     = stream
wait            = no
user            = root
server          = /usr/bin/cvs
server_args     = -f –allow-root=/fse/CVS_REP/cvs_docs   –allow-root=/fse/CVS_REP/cvs_classes pserver
log_on_failure  += USERID
}
初始化CVS
#su cvsroot
#cvs -d /fse/CVS_REP/cvs_docs init
#cvs -d /fse/CVS_REP/cvs_classes init
重启服务
#/etc/init.d/xinetd restart
检查CVS服务
#netstat -l | grep cvspserver
此处需打开防火墙的 2401 端口(见1_linix.txt),可在windows cmd: telnet 192.168.1.199 2401 检查是否打开
导入程序
-先进入到网站的根目录下 cd /ROOT/www/docs
cvsroot$ cvs -d /fse/CVS_REP/cvs_docs import -m “new www” docs vendor_tag release_tag
分配cvs帐号的脚本 adduse
#!/usr/bin/perl
# Simple script to take a username and password and
# return a line suitable for pasting into the CVS
# password file
// 添加用户
# exp: ./adduser.sh wangcy 123456 cvsroot >> cvs_other/CVSROOT/passwd
($u,$p,$g)=@ARGV;
@d=(A..Z,a..z);
$s=$d[rand(52)].$d[rand52];
print $u.”:”.crypt($p,$s).”:”.$g.”\n”;
提交cvs的同时发布新的代码到docs目录中
#vi cvs_other/CVSROOT/loginfo 最后一行增加
docs /fse/CVS_REP/cvs_docs/CVSROOT/log.in %s -f /fse/CVS_REP/cvs_docs/CVSROOT/commitlog  -a /fse/docs
classes /fse/CVS_REP/cvs_classes/CVSROOT/log.in %s -f /fse/CVS_REP/cvs_classes/CVSROOT/commitlog  -a /fse/classes
log.in文件.–>http://www.cnblogs.com/oxo/articles/472518.html

kill -9 `ps aux|grep commitlog|awk ‘{print $2}’`

______________________________________

建立帐号

#groupadd cvs

#useradd  cvsroot -g cvs

______________________________________

检查是否存在cvs端口服务,防火墙需要打开2401的权限。

#more /etc/services | grep cvspserver

看看是否有:

cvspserver  2401/tcp #CVS client/server operations

cvspserver  2401/udp #CVS client/server operations

______________________________________

#vi /etc/xinetd.d/cvspserver

service cvspserver

{

disable = no

flags           = REUSE

socket_type     = stream

wait            = no

user            = root

server          = /usr/bin/cvs

server_args     = -f –allow-root=/fse/CVS_REP/cvs_docs   –allow-root=/fse/CVS_REP/cvs_classes pserver

log_on_failure  += USERID

}

______________________________________

初始化CVS

#su cvsroot

#cvs -d /fse/CVS_REP/cvs_docs init

#cvs -d /fse/CVS_REP/cvs_classes init

______________________________________

重启服务

#/etc/init.d/xinetd restart

如果没有 xinetd 可以执行

#yum install xinetd

______________________________________

检查CVS服务

#netstat -l | grep cvspserver

此处需打开防火墙的 2401 端口    (如果没有开启防火墙,不用做这一步)

vi  /etc/sysconfig/iptables

在后面加

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 2401 -j ACCEPT

可在windows cmd: telnet 192.168.1.199 2401 检查是否打开

______________________________________

导入程序

-先进入到网站的根目录下 cd /ROOT/www/docs

cvsroot$ cvs -d /fse/CVS_REP/cvs_docs import -m “new www” docs vendor_tag release_tag

______________________________________

分配cvs帐号的脚本 adduse

vi /ROOT/CVS_REP/adduser.sh
给予执行权限
chmod +x

/ROOT/CVS_REP/adduser.sh

以下是文件内容 (”exp,“后面是执行范例,需要在 /ROOT/CVS_REP/文件夹下执行)

#!/usr/bin/perl

# Simple script to take a username and password and

# return a line suitable for pasting into the CVS

# password file

// 添加用户

# exp: ./adduser.sh wangcy 123456 cvsroot >> cvs_other/CVSROOT/passwd

($u,$p,$g)=@ARGV;

@d=(A..Z,a..z);

$s=$d[rand(52)].$d[rand52];

print $u.”:”.crypt($p,$s).”:”.$g.”\n”;

______________________________________

提交cvs的同时发布新的代码到docs目录中

#vi cvs_other/CVSROOT/loginfo 最后一行增加

docs /fse/CVS_REP/cvs_docs/CVSROOT/log.in %s -f /fse/CVS_REP/cvs_docs/CVSROOT/commitlog  -a /fse/docs

log.in文件内容及说明详见
http://www.wangchao123.com/2011/12/05/747

(标题未注明“转载”的为“原创”,转载请注明来源,欢迎来信交流 wangchao123.com@gmail.com)

  1. #1 by 青岛搬家公司 on 一月 4th, 2012

    新的一年,新的梦想http://www.andiam.com/

  2. #2 by 打底裤子 on 一月 18th, 2012

    博主的内容分析的好强大,认证阅读中。http://www.ddkz.net

  3. #3 by 安卓系统下载 on 一月 22nd, 2012

    不错,支持一下了。3nd3jz

  4. #4 by neodymium magnet on 二月 4th, 2012

    很好,很实用。一直都找这类内容!

(will not be published)

回到顶端 TOP

mian: ___38 queries ___ 0.371 seconds.