How to extract triggered job name in Jenkins using python -
i need extract name of running jenkins build using python script. 1 tell me how can extract jenkins triggered job's name @ runtime using python ?
i've never cared particular bit of information before, jenkins sets environment variables during build. appears need like:
import os job_name = os.getenv("job_name")
depending on build outside of jenkins environment, might useful specify default in case variable not set:
job_name = os.getenv("job_name", "(local build)")
wiki
Comments
Post a Comment