Hi,
There's a JenkinsApi package for Python:

https://jenkinsapi.readthedocs.io/en/latest/

Not sure what is accessible during a pipeline or if this is just for
completed build or old standard build for the Python API module (I haven't
test this yet).

You probably could pass the current build result, current build number and
the job name to your Python script so can reach the proper build info:

// Into Jenkins Pipeline
${env.JOB_BASE_NAME}
${env.BUILD_NUMBER}
${currentBuild.result}  // take care not set until something went wrong

As for launching Python script from buidl step see above, just use console
command and start the process, if you need some complexe return value, a
file could be used. Make sure the command return 0 if you want to continue
and doesn't return bad code, else you will need a try/catch into your
pipeline script.

Hope this help and I understood you properly this time, if not let us know,
Jerome

On Tue, Oct 11, 2016 at 7:02 AM, Mohan Radhakrishnan <
radhakrishnan.mo...@gmail.com> wrote:

> Are there some instructions to load Python code from disk as part of the
> build step ? This code should access Jenkins API. Is that possible ? I want
> to get the build status and act on it.
>
> Mohan
>
> On Thursday, 6 October 2016 22:47:07 UTC+5:30, jer...@bodycad.com wrote:
>>
>> Sorry my bad, I missread the question, this doesn'T interact with Jenkins
>> IDE API at all, sorry, reverse question, ignore my post, sorry.
>>
>> You proabbly will have to create a dummy Jenkins server that reside into
>> a VM or something like that and check if the command were operated. But I
>> don't have a clear solution for this. Sorry again.
>>
>> Jerome
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/iGmqEq02ybI/unsubscribe.
> To unsubscribe from this group and all its topics, 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/780238df-eafa-4388-8949-4ec1649a4c59%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/780238df-eafa-4388-8949-4ec1649a4c59%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKmu%2Be2fp_aGsQRsNru6-OYzktH0rUJgH3_ieT3ZUsvVHk_FsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to