I want to pass the teamcity username of the current logged in user to a build script called from teamcity, is there a property that has this? I didn't see one when I looked. It can't be a user specified property because I want it to be tied to their actual login so there is some sort of authentication of who t开发者_运维问答hey are.
I used properties %teamcity.build.triggeredBy% and %teamcity.build.triggeredBy.username%. These properties returns "John Doe" and "john.doe@user.mail". Using this values I can allow to run a build or not.
I've read that groovy plugin should be installed first to use these properties. But I can't check if I have it installed. I just do not have access to TeamCity administration settings.
The answer depends on what do you mean under the "current logged in user". Logged in where and why? In general TeamCity does not require to be logged on it in order to start a build. You can configure TeamCity to start a build on every commit to the specified VCS root, for example. In this case you can pass only name of the user, whose account is used for accessing the VCS root (%vcsroot.user%).
Another case, if you need a name of the windows user, under which account TeamCity build agent is running? If so, you can`t get it using TeamCity. You need to retrieve it inside of your build script.
精彩评论