Jenkins GIT Plugin

22 views
Skip to first unread message

Pradeep Murugesan

unread,
Feb 16, 2015, 5:44:53 PM2/16/15
to jenkins...@googlegroups.com
Hi all,

 I need to get the Author and message of the latest commit that jenkins is building upon. I see that there are no env variables for it.


I used printenv to see the variables set and AUTHOR / COMMITTER EMAIL and NAME are not set at all.

So I forked the source code to see what is happening and saw that name and email are populated from global config and not from the commit.

GitSCM.java

public void populateEnvironmentVariables(Map<String,String> env) {
           
String name = getGlobalConfigName();
           
if (name!=null) {
                env
.put("GIT_COMMITTER_NAME", name);
                env
.put("GIT_AUTHOR_NAME", name);
           
}
           
String email = getGlobalConfigEmail();
           
if (email!=null) {
                env
.put("GIT_COMMITTER_EMAIL", email);
                env
.put("GIT_AUTHOR_EMAIL", email);
           
}
       
}



Am I missing something here. Please let me know if anyone already captures the parameters I am mentioning,

Pradeep
Reply all
Reply to author
Forward
0 new messages