Denis
Denis

Reputation: 81

How to execute python script in post-build actions?

It's kind like a simple question. How to execute python script in post-build actions ? But I can't find how to do it...

I found this variant: via Groovy Post-Build plugin. def command = """ python -c "......" """

but I need a full-fledged version of the Python script, something like "Python Post-Build plugin". Any ideas, how to do it ? Thanks.

Upvotes: 4

Views: 9702

Answers (2)

Santosh Pillai
Santosh Pillai

Reputation: 8623

Another way:

  1. In the 'Execute Windows Batch Command' of the post build, Switch to the directory where you have your python project.

    cd D:\Dashboard

  2. Write your python path followed by your python script

    D:\Applications\python\python.exe D:\Dashboard\serenity_scrapper.py

Upvotes: 0

rgulia
rgulia

Reputation: 523

Install the "Post Build Script" plugin https://wiki.jenkins-ci.org/display/JENKINS/PostBuildScript+Plugin. It allows to execute a script in post build phase.

You will be able to select "Execute a set of scripts" from the "Add post build action" pull down menu. It will present you a set of pull down menus from which to choose the type of script which you want to execute.

The "Add Build Step" pull down menu contains the "Execute Python Script" that you are looking for.

Upvotes: 6

Related Questions