简体   繁体   中英

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM