You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prayaas-a edited this page Jun 24, 2019
·
3 revisions
When your code is being executed as part of Team City build steps:
First, initialize a LocalTc object.
varlocalTc=newLocalTc();
Now, you can use various methods that are members of LocalTc to get or set Team City data.
Getting a pre-defined build parameter: You can access one of the predefined build parameters. For instance, let's access teamcity.build.id. In general, we do not consider prefixes to be part of the parameter name. Thus, you should pass "build.id" as the argument to GetBuildParameter(string parameterName).
varbuildId=localTc.GetBuildParameter("build.id");
Getting or setting a custom parameter: Custom build parameters must be set as a System Property. System properties will show up with a "system." prefix to their name. So, a custom defined parameter with the name "domain" shows up as "system.domain". Similar, to the example above, pass just "domain" as the argument. You can also set a value from code for non-readonly parameters: