3

我正在做一个小项目,该项目需要将 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

有用!

Jenkins 解决方案快照

4

2 回答 2

1

这听起来你非常接近解决这个问题。可以肯定的是,请检查是否已完成以下操作:

  1. 确保在访问该位置时包含用户名和密码。

像这样:

net use Q: \\Server\files < password > /User:<username>

或者如果您想使用 Jenkins 的变量,请执行以下操作:

net use Q: \\Server\files < password > /User:%USERNAME%

将 <密码> 替换为您的实际密码。

  1. 最后,确保 Jenkins 用户对 SharePoint 文档库具有写入权限。SharePoint 系统中有一些组将指示用户将拥有的权限类型。您可能需要自己的权利才能查看这些列表。只要确保那些排成一行。
于 2016-03-18T02:56:23.073 回答
0

我在使用 ArtifactDeployer 时也遇到了麻烦。Austin Kincaid 的解决方案对我不起作用,但让我找到了一个可行的解决方案。我将共享点位置映射为构建机器上的驱动器。然后在我的构建步骤中,我使用批处理命令将所需文件从我的 Jenkins 工作区复制到映射驱动器。

于 2016-10-28T16:07:44.007 回答