This Question is Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
2 Replies Last post: Oct 6, 2009 1:04 PM by stefan_b  
stefan_b Newbie 8 posts since
May 27, 2009
Currently Being Moderated

May 27, 2009 7:58 PM

Accessing perforce settings on agent (ant build)

Hi,

 

is there a way to get the perforce settings on the agent (running an ant build script) ?

 

In order to generate a build description for Escrow builds (http://en.wikipedia.org/wiki/Source_code_escrow)

we need to include all information that is necessary to extract the sources from perforce

using the changelist number (which we got as the team city build number) plus the perforce

client mapping (workspace). The agent could query it's own configuration setting (VCS root) but when

P4 Connection Settings is specified using      "Client:"  the agent would need to login to perforce to

extract the workspace...

 

Any ideas on this would be great...

 

Stefan

Kirill Maximov JetBrains 1,931 posts since
Aug 23, 2002
Currently Being Moderated
May 28, 2009 9:43 AM in response to: stefan_b
Re: Accessing perforce settings on agent (ant build)

Hello Stefan,

 

  The only thing I can think of by the moment is to write a TeamCity server-side plugin which implements TeamCity extension jetbrains.buildServer.serverSide.ParametersPreprocessor to pass this information as a system property to build agent.

 

  To get mapping information in the preprocessor, ask SRunningBuild (this is not production code, just a hint how to obtain info):

  build.getBuildType().getVcsRoots().get(0).getProperty("client-mapping")

  You can put this value to buildParameters map under some key:  params.put("env.VCS_MAPPING", value), in this case the mapping should be available to your build via VCS_MAPPING environment variable.

 

  Kind regards,

  KIR

More Like This

  • Retrieving data ...