cvs 返回工作副本修订状态
我正在编写一个 puppet 清单,以从 cvs 存储库部署我们的代码。到目前为止,我有以下内容:
define codedeploy::cvs ($module, $tag, $copydir) {
file { "$copydir":
owner => www-data,
group => www-data,
mode => 755,
ensure => directory
}
#bypass cvs login, we'll just inject a ~/.cvspass file
# to do
#initial cvs checkout
exec { "cvscheckout-$name":
command => "cvs co -r $tag -d $name $module",
creates => "$copydir/$name/CVS",
require => [Package[cvs], File["$copydir"]],
environment => "CVSROOT=:pserver:robots@codeserver:/cvs/repository",
cwd => "$copydir"
}
#cvs update to tag
exec { "cvsupdate-$name":
command => "cvs up -r $tag",
require => [Package[cvs], File["$copydir"], Exec["cvscheckout-$name"] ],
environment => "CVSROOT=:pserver:robots@codeserver:/cvs/repository",
cwd => "$copydir/$name",
unless => #NEED TO FIGURE THIS PART OUT!
}
}
我不知道的部分是如何返回工作副本的修订状态,以便它不会在每次木偶运行时调用 cvs update。 cvs 是否有命令返回整个工作树的当前标签或修订 ID?当我执行 cvs diff 时,它似乎知道它应该比较该标签下的所有文件,但是我不确定在检查后如何返回工作副本的标签 id。
谢谢!
I'm working on a puppet manifest to deploy our code from a cvs repository. I have the following so far:
define codedeploy::cvs ($module, $tag, $copydir) {
file { "$copydir":
owner => www-data,
group => www-data,
mode => 755,
ensure => directory
}
#bypass cvs login, we'll just inject a ~/.cvspass file
# to do
#initial cvs checkout
exec { "cvscheckout-$name":
command => "cvs co -r $tag -d $name $module",
creates => "$copydir/$name/CVS",
require => [Package[cvs], File["$copydir"]],
environment => "CVSROOT=:pserver:robots@codeserver:/cvs/repository",
cwd => "$copydir"
}
#cvs update to tag
exec { "cvsupdate-$name":
command => "cvs up -r $tag",
require => [Package[cvs], File["$copydir"], Exec["cvscheckout-$name"] ],
environment => "CVSROOT=:pserver:robots@codeserver:/cvs/repository",
cwd => "$copydir/$name",
unless => #NEED TO FIGURE THIS PART OUT!
}
}
The part which I don't know is how I can return the revision status of the working copy, so that it won't call cvs update every puppet run. Does cvs has a command to return the current tag or revision id of the entire working tree? When I do a cvs diff it seems to know it should be diffing all the files under that tag, however I'm not sure how I can just return the tag id for my working copy after I've checked it out.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜您可以使用
cvs status
来查看是否需要检查任何更改。但是,每次都运行
cvs up
有什么坏处呢?我的 cron 作业每小时或每天做同样的事情,我认为这不是什么大问题。如果你的代码库非常庞大,我想这就是一个原因:)I would guess that you can use
cvs status
to see if you need to check any changes in.However, what's the harm in just running
cvs up
every time? I have cron jobs that do the same thing hourly or daily, and I don't think it's much of an issue. If your codebase is ginormous I suppose that's a reason :)