NAnt XMLPoke 通过 FTP 进行远程配置?
我熟悉在网络中复制文件,但我需要将文件通过 FTP 传输到远程服务器,并查看配置文件以获得正确的日志记录设置。对于本地副本,我使用类似以下内容:
<xmlpoke file="${PublishLocation}\web.config" xpath="/configuration/appSettings/add[@key='LogLocation']/@value" value="${LoggingLocation}" />
很好,但是这如何与 FTP 推送一起使用?是否可以将文件复制上去然后戳值?或者我必须在复制之前先设置值(我假设是 xmlpoke)?
谢谢。
I'm familiar with copying files in our network but I need to FTP the files to a remote server, and also poke the config file for the proper logging settings. For a local copy I use something like:
<xmlpoke file="${PublishLocation}\web.config" xpath="/configuration/appSettings/add[@key='LogLocation']/@value" value="${LoggingLocation}" />
Great and all, but how does this work with an FTP push? Is it possible to copy the files up and then poke the values? Or do I have to set the values first (xmlpoke I assume) before I copy?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为无法在
任务中指定 URL,所以是的,您必须在本地进行修改,然后推送到 FTP 位置。 NAntContrib 任务似乎也没有任何可以做到这一点的东西。您可以尝试使用 Serge 的
自定义任务 并通过调整它以使用 FtpWebRequest 并在流上搭载 XML 编写器来修改它。不是难以克服的困难,但也不是微不足道的。我建议只在本地更新然后上传:)I see no way to specify a URL in the
<xmlpoke>
task, so yeah, you'll have to modify locally and then push to the FTP location. The NAntContrib tasks don't seem to have anything that will do that either. You could try to use Serge's<xmllist>
custom task and modify it by adapting it to use FtpWebRequest and piggyback the XML writer on the stream. Not insurmountably difficult, but not trivial either. I'd recommend just updating locally and then uploading :)