Parameter wildcard expansion

Hi, is there any way to in a build script, get the values of all build parameters which match a pattern like "teamcity.locks.readLock.*"?

4 comments
Comment actions Permalink

Hi Jared,

No, it is not possible to use wildcards in build parameter in build script. How are you going to use "teamcity.locks.readLock.*"? What is your use case?

0
Comment actions Permalink

Hi Alina, thanks for the reply.  The use case is that we have several types of shared resources (pre-configured user accounts) which are used in different combinations in different build configurations.

In order to pass the locked resources to our test scripts, we would like to save all available shared resources into environment variables as part of the build template but there doesn't seem to be a way to just get a list of all the locked resoruces so a build step could accomplish that.  

Also, these accounts are modified by our build script and need to be reset to their initial state after or just before the build completes and the locks are released.

We'd like to have a build step or some other mechanism in the template which does the resetting, but need to have a list of the shared resources which were locked for the build.  This we could possibly do as part of the test script, but were curious if it could be done as a separate build step.  

0
Comment actions Permalink

Is there at least a way to access a list of ALL the teamcity.* parameters during a build?

0
Comment actions Permalink

I thought of using the REST API during the build to retrive the list with http://teamcity:8111/guestAuth/app/rest/builds/id:/resulting-properties which actually included these lines in the output:

<property name="teamcity.locks.readLock.account_type_1" value=""/>
<property name="teamcity.locks.readLock.account_type_2" value=""/>

But as you can see, the values are missing!  I have verified that those variables do actually have values during the build by checking them in the build script.  

0

Please sign in to leave a comment.