Jenkins - How do I pass Email-ext plugin's "Culprits" email list variable to a build step? -


culprits list of users committed change since last non-broken build till now. jenkins email-ext plugin able send email culprits during post-build action.

i want use list of emails defined culprits in python script build step inside of jenkins job.

can suggest how can this?

the 'culprits' list comes scm plugin in jenkins , includes users have committed since last successful build. email-ext plugin sourcing list scm , generating email addresses based on following heuristic

the plugin generate email address based on committer's id , appended "default email suffix" jenkins's global configuration page. instance, if change committed id "first.last", , default email suffix "@somewhere.com", email sent "first.last@somewhere.com"

if email addresses have sort of pattern (and must do, otherwise email-ext plugin not generating correct addresses) can generate them inside groovy script eg:

import hudson.model.* def culprits = build.getculprits() def list = culprits.collect{it.getfullname().tolowercase().replace(" ", ".") + "@mydomain.com"} 

this example convert culprit "adam smith" adam.smith@mydomain.com replace call getfullname() call getid() , manipulate appropriate. eg:

def list = culprits.collect{it.getid().tolowercase() + "@mydomain.com"} 

which basic format email-ext uses - can full list of user properties documentation.

now have list in groovy script, how make list available python script? come down used doing. write list workspace , read python, or save result environmental variable, or save build parameter.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -