【发布时间】:2016-03-16 17:44:26
【问题描述】:
我正在处理一个小项目,该项目需要将 markdown 文件的 git 存储库复制到 SharePoint 目录。我在项目中使用 Jenkins,但现在遇到了问题。
我是 Jenkins 的新手,但我发现了 ArtifactDeployer 的构建后操作,它起初似乎是解决方案。一切正常,直到 ArtifactDeployer 尝试移动文件。这是输出:
[ArtifactDeployer] - Starting deployment from the post-action ...
[ArtifactDeployer] - [ERROR] - Failed to deploy. Can't create the directory 'https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown'
[ArtifactDeployer] - [ERROR] - Failed to mkdirs: https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown
Build step '[ArtifactDeployer] - Deploy the artifacts from build workspace to remote locations' changed build result to FAILURE
Build step '[ArtifactDeployer] - Deploy the artifacts from build workspace to remote locations' marked build as failure
Finished: FAILURE
此时我认为 ArtifactDeployer 可能不是实际的解决方案。这些错误并不是特别有启发性,但我的猜测是它与 HTTP 不兼容。提供的目录已经存在,因此不需要实际创建。
现在我正在寻找替代解决方案。我正在考虑通过电子邮件将文件发送到 SharePoint。也许使用 Jenkins 的 FTP-Publisher 插件会起作用。我只是想总结一下。
任何帮助或指导将不胜感激。谢谢。
编辑:在查看电子邮件选项时,您可以通过电子邮件将文件发送到文档库。甚至可以选择按电子邮件主题将文件分组到一个文件中。我的测试表明您不能将文件存储两层深,只有一层。当然,我的目标文件夹是两层深的。这对我们不起作用。
我正在研究的新可能解决方案是将地址映射到批处理文件中的驱动器,使用 ArtifactDeployer 移动文件,并在另一个最终批处理文件中删除映射的驱动器。
最新一期是:
System error 1244 has occurred.
The operation being requested was not performed because the user has not been authenticated.
Jenkins 用户拥有 SharePoint 文档库的管理员权限,目前尚不清楚为什么会发生这种情况。
分辨率:
我现在可以正常工作了。部分感谢我收到的一个答案和一些修修补补。我可以确认您的 Jenkins 用户需要在 SharePoint 中具有适当的权限级别才能完成此任务。它现在可以与 ArtifactDeployer 一起使用。以下是 Jenkins 设置的主要内容:
执行 Windows 批处理命令:
net use D: "https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown" password123 /User:%USERNAME%
D:
...ArtifactDeployer 做它的事...
执行 Windows 批处理命令:
net use D: /D
有效!
【问题讨论】:
-
您能分享更多关于环境的信息吗?即你的詹金斯大师是Linux\Windows?您的 SP 是否只能通过 HTTP 访问,或者其他选项也适用(例如将文件复制到 SP 服务器上的某个目录)
-
绝对! Jenkins master 是基于 Windows 的。遗憾的是,我们的 SharePoint 只能通过 HTTP 访问。
标签: sharepoint jenkins artifact-deployer