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!