admin管理员组文章数量:1122816
I have installed Jenkins as a service on my windows 10 computer. Jenkins connects via SSH to the machine.
The pipeline script looks like this:
timestamps {
node('abc') {
stage("exec") {
bat """
echo 'script start'
D:\\tools\\python\\python.exe D:\\test_dir\\test_script.py
echo 'script end'
"""
}
}
}
The python script is getting triggered. In the python script I am calling a program via subprocess.Popen(). For example MS Edge:
proc = subprocess.Popen(['C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'])
print(f"{proc.pid=}")
time.sleep(60) # sleep for a minute
The subprocess gets created and the pid is printed to the console. But Edge does not open... also in the Task Manager the process is not showing up.
I tried launching the python script locally and it worked. Is there any better way to do this than with subprocess.Popen() ?
I think it has something to do with windows sessions ans processes, but I have no idea how exactly they work.
本文标签: pythonstart a program via Jenkins serviceStack Overflow
版权声明:本文标题:python - start a program via Jenkins service - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736312432a1935094.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论