我用Python编写了一个脚本,在其中我通过cli启动了Jenkins构建:
import subprocess
command = "curl -s -X POST http://<user>:<token>@<server>/build"
subprocess.Popen(command)
我需要找到一种检查构建状态的方法,例如:
If not started : Wait to start
If started : on progress
If ended : Success / Failure
这样做:
while True:
# Check the status of the build
# ... <----- I don't know what to do here
if STATUS == "on progress"
break
感谢您的建议
答案 0 :(得分:2)