1

I'm trying to pass a standard teamcity build parameter vcsroot.url as the parameter of a rake task, using Teamcity's built in Rake build step. However, the build parameter doesn't seem to be evaluated.

In the "Rake Tasks" box, I've got:

setup_github_pages["%vcsroot.url%"]

When I run this build I get the following error:

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

Yet on the build results parameter tab, I see the correct value for the vcsroot.url parameter.

Are there rules about which build step fields do / don't have parameter substitution performed? Or is there an escape sequence required (I've scoured the teamcity docs in vain...)

Alex
  • 985
  • 9
  • 11

1 Answers1

0

Try adding a custom environment variable to expose the configuration variable you're trying to access:

Reference Teamcity and Rake: Where are the tc system properties?

For example, you want to pass system.CUSTOM property defined in the agent.conf file. Click the Add new variable link, specify CUSTOM as a name and %system.CUSTOM% as a value. Now in the rakefile you can access it as ENV['CUSTOM'].

I've been able to access vcsroot.url directly from within the rake task using this approach.

Community
  • 1
  • 1
9swampy
  • 1,306
  • 12
  • 21