我正在处理 puppet manifest 以从 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!
}
}
我不知道的部分是如何返回工作副本的修订状态,这样它就不会在每次 puppet 运行时调用 cvs update。cvs 是否有返回整个工作树的当前标签或修订 ID 的命令?当我做一个 cvs diff 时,它似乎知道它应该区分该标签下的所有文件,但是我不确定在我检查它之后如何才能返回我的工作副本的标签 ID。
谢谢!