folex
folex

Reputation: 5287

How to use Teamcity commands (##teamcity[...])?

I want to pass some information to another build step. E.g. for build tagging. How do I do that?

I've tried ##teamcity[setParameter name='xxx' value='111'] in my script, but it doesn't seem to do anything.

Upvotes: 0

Views: 142

Answers (1)

folex
folex

Reputation: 5287

Well, first you need to define custom parameter in Build configuration -> Parameters. Then you should set it like in question, but with one nuance: you should echo command! And there isn't a word about that in docs :(

In the end, you need to do this: echo ##teamcity[setParameter name='xxx' value='111'] in your script, and then, in next build step you could use it as usual Teamcity variable: %xxx%.

P.S. xxx would be initialized only in next build step, so don't use it for anything else but setting value in this build step.

Upvotes: 1

Related Questions