集中 Haskell/Darcs 工具链的轻量级持续集成?

发布于 2024-09-28 12:58:12 字数 745 浏览 3 评论 0原文

我想要一些简单的 CI 用于小型开发设置。有两个动机——完整的构建需要一些时间,预期的测试套件也需要一些时间。我真的不想一头扎进需要java应用程序容器或其他任何东西来显示具有多种颜色的精美图表等的大玩家之一。我对“文化上”的Haskellish特别感兴趣——最好是命令行交互或配置文件,并且与 Darcs 的互操作是绝对必须

是否存在这样的工具,或者我是被大公司之一困住了还是自己写了?

说到这里,我记得有一个为GHC设立的建造农场。看着它,我注意到它曾经使用 buildbot,现在使用自定义构建器。尽管它们是针对不同的工作流程设置的,但它们中的任何一个都是更简单、更直接的解决方案吗?

编辑:我现在要使用 buildbot。将更新其运作方式。

Edit2:Ben Lippmeier 将 buildbox 放在 hackage 上,这似乎也是本机 Haskell CI 解决方案的基础。目前它的文档记录不足,并且可能无法满足我的需求,但它是:http://hackage。 haskell.org/package/buildbox。他用它为 repa 编写了一个构建机器人:http://code.haskell。 org/repa/repa-head/repa-bot/.

I want some simple CI for a small dev setup. Two motivations -- a full build takes some time, and an anticipated testsuite will also take some time. I really would rather not dive headfirst into one of the big players that require a java application container or whatever to show fancy graphs with multiple colors and etc. I'd be interested in something "culturally" Haskellish in particular -- preferably command line interaction or config files, and interop with Darcs is the absolute must.

Do any such tools exist, or am I stuck with one of the big players or writing my own?

Speaking of which, I recall that there's a build farm set up for GHC. Looking at it, I notice that it used to use buildbot and now uses a custom builder. Although those are set up for a different workflow, would either of them be a simpler, more straightforward solution?

Edit: I'm going with buildbot for now. Will update with how it works out.

Edit2: Ben Lippmeier has put buildbox on hackage, which also seems to be the foundation for a native Haskell CI solution. It is currently underdocumented, and probably not feature complete for my needs, but here it is: http://hackage.haskell.org/package/buildbox. He's used it to write a buildbot for repa: http://code.haskell.org/repa/repa-head/repa-bot/.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

千と千尋 2024-10-05 12:58:12

这就是我所做的。

  1. 按照说明安装 buildbot-server/buildslave。
  2. 安装darcs_buildbot脚本: https://github.com/buildbot /buildbot/blob/master/master/contrib/darcs_buildbot.py
  3. 将 _darcs/defaults 中的 apply posthook (适用于共享存储库)更改为以下内容:

应用 posthook chmod a+w myrepo/_darcs/index myrepo/.darcs_buildbot-lastchange; /usr/local/bin/darcs_buildbot.py buildbotmachine:buildbotport;

应用run-posthook

至于 buildbot 配置文件,如下是一个简单的设置:

darcsroot = "/myrepo/"

from buildbot.process import factory
from buildbot.steps.source import Darcs
from buildbot.steps.shell import Compile
from buildbot.steps.shell import Test
f1 = factory.BuildFactory()
f1.addStep(Darcs(repourl=darcsroot))
f1.addStep(Compile(command=["ghc","--make","Setup.hs"]))
f1.addStep(Compile(command=["./Setup","configure"],warningPattern="^\(Warning:"))
f1.addStep(Compile(command=["./Setup","build"],warningPattern="^\(Warning:"))    
b1 = {'name': "buildbot-full",
      'slavename': "bot1name",
      'builddir': "full",
      'factory': f1,
      }
c['builders'] = [b1]

调度程序等也需要根据文档进行配置。

现在,每当有人推送到共享存储库时,就会触发构建。还可以轻松添加其他测试命令。

到目前为止,这一切进展顺利!

我想我修补了 buildslave 以增量方式拉取而不是完整的存储库,但我不记得我做了什么,也不知道新版本是否仍然有必要。

So here's what I did.

  1. install buildbot-server/buildslave as per instructions.
  2. install the darcs_buildbot script: https://github.com/buildbot/buildbot/blob/master/master/contrib/darcs_buildbot.py
  3. change the apply posthook in _darcs/defaults (this is for a shared repo) to the following:

apply posthook chmod a+w myrepo/_darcs/index myrepo/.darcs_buildbot-lastchange; /usr/local/bin/darcs_buildbot.py buildbotmachine:buildbotport;

apply run-posthook

As for the buildbot config file, something like the following is a simple setup:

darcsroot = "/myrepo/"

from buildbot.process import factory
from buildbot.steps.source import Darcs
from buildbot.steps.shell import Compile
from buildbot.steps.shell import Test
f1 = factory.BuildFactory()
f1.addStep(Darcs(repourl=darcsroot))
f1.addStep(Compile(command=["ghc","--make","Setup.hs"]))
f1.addStep(Compile(command=["./Setup","configure"],warningPattern="^\(Warning:"))
f1.addStep(Compile(command=["./Setup","build"],warningPattern="^\(Warning:"))    
b1 = {'name': "buildbot-full",
      'slavename': "bot1name",
      'builddir': "full",
      'factory': f1,
      }
c['builders'] = [b1]

Schedulers, etc. also need to be configured as per docs.

Now whenever anybody pushes to the shared repo, the build is triggered. Additional test commands can be added easily as well.

So far, this has been working out great!

I think I patched the buildslave to pull incrementally rather than the full repo, but I can't remember what I did, and don't know if its still necessary with newer versions.

救星 2024-10-05 12:58:12

Darcs 团队本身使用 buildbot。我不确定这些脚本在哪里,但我确信如果您在邮件列表或 IRC 上询问,它们应该很容易找到。

The darcs team itself uses buildbot. I'm not certain off the top of my head where the scripts live, but I'm sure if you ask on the mailing list or IRC they should be easy to get hold of.

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