开发者

hudson: Variable that returns which user initiated the build?

is it possible to get the username of the user who initiated a build on Hudson ? There doesn't seem to be any hudson environment variab开发者_JAVA技巧le for username.

otherwise, how are you supposed to return specific builds running under a certain user remotely using the API ?


Can you state why you need the jobs started by a specific user? If it is just for the particular user than it might be enough to just use the security settings, which will limit the amount of jobs that they are seeing. In addition, for my installation, it will usually not show anything, because the vast majority of the jobs will only be triggered by the SCM. Following some ideas.

You can try the remote API.

http://<HudsonURL>/job/<JobName>/lastBuild/api/xml

The previous link will return an XML file. There you should find a cause tag. I don't know if that information is available when the job is still running.

Alternatively, ask for an extension of the Job Filter Plugin to incorporate a filter for jobs last run (or that are currently running) by username.


http://wiki.hudson-ci.org/display/HUDSON/Quick+and+Simple+Security shows a way to launch hudson as a specific user.

$ java -jar hudson.war --argumentsRealm.passwd.user=password --argumentsRealm.roles.user=admin

It seems argumentsRealm will hopefully have some user information in it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜