简体   繁体   中英

Run/execute local python scripts in Jenkins

I am new to Jenkins and want to schedule a job to execute a local python script. I tried copying all my python script into the "execute shell" however it doesn't work as it doesn't recognize some of the libraries as import jenkins and import p4 in my script. Any Idea how I could fix that?

If you want to execute a python script using "execute shell" parameters you should use shell syntax:

#!/bin/sh
python /home/Username/my_script.py

The absolute path to the script is required.

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