有谁知道 msbuild 的 SFTP 任务吗? 我们希望自动部署到生产环境,但出于安全原因,我们不允许从我们的开发/测试/构建环境到生产环境进行 SMB 文件共享访问。
目前,开发人员通过 SFTP 连接使用 FileZilla 手动上传文件来部署代码。 这很容易出错,因此我们计划自动执行 SFTP 上传。 不过,如果除了 SFTP 之外还有其他同样安全的机制,我很乐意使用它。
我正在考虑仅使用“exec”msbuild 任务和命令行 ftp 客户端(例如 pscp)。 但如果有人已经构建了 sftp 任务,那当然很棒。
谢谢,
理查德
Does anyone know of an SFTP task for msbuild? We'd like to automate our deployments to production, but for security reasons we don't allow SMB file-share access from our dev/test/build environment to production.
Right now, developers deploy code by manually uploading the files using FileZilla, over an SFTP connection. This is pretty error-prone, so we're planning to automate the SFTP upload. Though if there's some mechanism other than SFTP which would be just as secure, I'd be happy to use that instead.
I'm thinking of just using the "exec" msbuild task, and a command-line ftp client such as pscp. But if someone's built an sftp task already, that would of course be great.
Thanks,
Richard
发布评论
评论(6)
可以安装 WinSCP 并仅使用 MsBuild Exec Task
我使用了类似的东西构建后将 ISO 文件上传到服务器。
Could install WinSCP and just use the MsBuild Exec Task
I used something like the following to upload an ISO file to a server after a build.
我通常完全按照 Ryu 的做法并使用 WinSCP,但我更进一步,使用 WinSCP 的脚本功能来映射更可定制的部署。
我在一篇详细介绍完整设置的博客文章中详细介绍了这一点:
http://www.diaryofaninja.com/blog/2010/09/21/continuous-integration-tip-1-ndash-ftp-deployment
但它的基本要点是将脚本文件传递给 WinSCP,如下所示:
我的脚本如下所示:
I usually do EXACTLY as Ryu has done and use WinSCP, however i take it one step further and use WinSCP's scripting capabilities to map a more customizable deployment.
I've detailed this in a blog post that details the full setup:
http://www.diaryofaninja.com/blog/2010/09/21/continuous-integration-tip-1-ndash-ftp-deployment
however the basic gist of it is passing in a script file to WinSCP as follows:
and my script looks like:
FileZilla 也支持 命令行。
FileZilla also supports this from the command line.
安装 putty 并使用命令行工具将文件通过 sftp 传输到服务器。 使用页面和按键来避免硬编码或重复输入密码。
Install putty and use the commandline tools to sftp your files to the server. Use pagent and keys to avoid hardcoding or typing your password repeatedly.
有很多基于 .net 的 SSH 工具,选择一个并使用 msbuild 任务(创建您自己的)或 ccnet 任务包装它。
Ant 有一个 scp 任务,如果可能的话,从 msbuild 调用 ANT 脚本。 无论如何,使用强大的公钥/私钥进行加密。
There are lots of .net based SSH tool, take one and wrap it using msbuild task(create your own) or ccnet task.
Ant has a scp task, if possible call a ANT script from msbuild. whatever case use strong public/private key for encryption.
edtFTPnet/PRO 为 .NET 中的 SFTP 提供全面支持。
如果您有兴趣购买副本,我们很乐意为您编写 MSBuild SFTP 任务 - 这将是一个方便的功能。 网站上的联系方式。
edtFTPnet/PRO offers full support for SFTP in .NET.
If you are interested in purchasing a copy we'd be happy to write an MSBuild SFTP task for you - it'd be a handy feature. Contact details on the site.