【问题标题】:Rakefile Parameter substitution in teamcityteamcity 中的 Rakefile 参数替换
【发布时间】:2014-10-19 11:19:22
【问题描述】:

我正在尝试使用 Teamcity 内置的 Rake 构建步骤将标准 teamcity 构建参数 vcsroot.url 作为 rake 任务的参数。但是,构建参数似乎没有被评估。

在“Rake 任务”框中,我有:

setup_github_pages["%vcsroot.url%"]

当我运行此构建时,我收到以下错误:

[Execute setup_github_pages] NoMethodError: undefined method `[]' for nil:NilClass

但在构建结果参数选项卡上,我看到了 vcsroot.url 参数的正确值。

是否有关于哪些构建步骤字段执行/不执行参数替换的规则?或者是否需要转义序列(我已经徒劳地搜索了 teamcity 文档......)

【问题讨论】:

    标签: rake teamcity-7.1


    【解决方案1】:

    尝试添加自定义环境变量以公开您尝试访问的配置变量:

    参考Teamcity and Rake: Where are the tc system properties?

    例如,您想传递在 agent.conf 文件中定义的 system.CUSTOM 属性。单击添加新变量链接,将 CUSTOM 指定为名称,将 %system.CUSTOM% 指定为值。现在在 rakefile 中,您可以作为 ENV['CUSTOM'] 访问它。

    我已经能够使用这种方法直接从 rake 任务中访问 vcsroot.url。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-08
      • 2014-11-10
      • 1970-01-01
      • 1970-01-01
      • 2013-06-29
      • 1970-01-01
      相关资源
      最近更新 更多