2

我的测试需要index.html从 localhost ant 运行一个文件,而不是file:///. 这意味着我需要启动一个本地网络服务器并使用它来展示我的网站。所有这些都来自 cloudbees 中的 jenkins 脚本。如何以及是否可以实现?

谢谢!

4

1 回答 1

0

您可以使用 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一步启动。

于 2013-10-16T00:19:08.040 回答