Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Jenkins, how do builds know who requested them?

I need to pass the username of the requester of a build down to the script that is actually doing the work. Looking at the console output for a particular build, the first line is always "Started by user foo," so Jenkins is clearly keeping track of who triggered the build. So it should be possible to pass that information down to the job. The question is, how?

like image 983
Sniggerfardimungus Avatar asked May 05 '11 18:05

Sniggerfardimungus


People also ask

How do you check who triggered the build in Jenkins?

Looking at the console output for a particular build, the first line is always "Started by user foo," so Jenkins is clearly keeping track of who triggered the build. So it should be possible to pass that information down to the job.

What is used to track the changes between builds in Jenkins?

The simplest way to know what has changed on your Jenkins builds! Last Changes is a Jenkin plugin that shows rich VCS diffs between builds.

How are agents differentiated so that Jenkins knows where to run a project?

Labels are tags one can give an agent which allows it to differentiate itself from other nodes in Jenkins. A few reasons why node labels are important: Nodes might have certain tools associated with it. Labels could include different tools a given node supports.


1 Answers

user30997

Please check out Jenkins Build User Vars plugin, it does what you need:

It is used to set following user build variables:

  • BUILD_USER – full name of user started build,
  • BUILD_USER_FIRST_NAME – first name of user started build,
  • BUILD_USER_LAST_NAME – last name of user started build,
  • BUILD_USER_ID – id of user started build.
like image 84
Milkywayfarer Avatar answered Sep 24 '22 20:09

Milkywayfarer