我正在尝试在python脚本中执行以下curl命令,以使用命令行中的参数远程触发Jenkins作业。
curl -XGET https://"+username+":"+password+"@myjenkinsurl/buildWithParameters?jenkinstoken=myjenkinstoken¶meter1=test1¶meter2=test2
如何使用subprocess
包在Python脚本中执行相同的操作?我尝试了以下操作,但没有成功:
subprocess.call(["curl","-XGET","username:username","password:mypassword","myjenkinsurl/buildWithParameters?","token:myjenkinstoken","paramter1:test1","parameter2:tet2"],shell=False)