Hi @ all,

I have a pipeline job in jenkins 2.36, which can be triggered by a remote 
http-call. Now I have to inject the ip-address of the calling client. In a 
normal job I did this with the EnvInject-Plugin with following script:
import hudson.model.*
import static hudson.model.Cause.RemoteCause


def ipaddress=""
for (CauseAction action : currentBuild.getActions(CauseAction.class)) {

    for (Cause cause : action.getCauses()) {
        if(cause instanceof RemoteCause){
             ipaddress=cause.addr
             break;
        }
    }
}
return ["ip":ipaddress]

But how can I achieve this with the pipeline-plugin? I cannot use the 
EnvInject-Plugin in this :-(

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8d0cc6fb-da55-4e7d-b44a-73cad29e70ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to