Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的测试需要index.html从 localhost ant 运行一个文件,而不是file:///. 这意味着我需要启动一个本地网络服务器并使用它来展示我的网站。所有这些都来自 cloudbees 中的 jenkins 脚本。如何以及是否可以实现?
index.html
file:///
谢谢!
您可以使用 python 启动一个小型 HTTP 服务器,该服务器将提供静态文件
mkdir /tmp/htdocs cd /tmp/htdocs echo index > index.html python -m SimpleHTTPServer 9090 & sleep 5 curl -S http://localhost:9090/index.html
这可以Execute shell一步启动。
Execute shell