cvs 返回工作副本修订状态

发布于 2024-10-17 06:19:33 字数 1199 浏览 2 评论 0原文

我正在编写一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难如初 2024-10-24 06:19:33

我猜您可以使用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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文