Hi, thanks for your answer :)

But how can I inject this variable? Is it like this:

withEnv(["ip"]) { //Script for getting the ip }

Sorry I'm a newby in Jenkins and Groovy. How can I set the scrpit security 
for allow binary API calls?

Am Dienstag, 27. Dezember 2016 13:45:56 UTC+1 schrieb Andreas Wuz:
>
> 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/fab7754a-e0d2-4f7f-8ca2-7a084ebf0369%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to