【问题标题】:Jenkins Publishing to SharePointJenkins 发布到 SharePoint
【发布时间】: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

有效!

Snapshot of Jenkins Solution

【问题讨论】:

  • 您能分享更多关于环境的信息吗?即你的詹金斯大师是Linux\Windows?您的 SP 是否只能通过 HTTP 访问,或者其他选项也适用(例如将文件复制到 SP 服务器上的某个目录)
  • 绝对! Jenkins master 是基于 Windows 的。遗憾的是,我们的 SharePoint 只能通过 HTTP 访问。

标签: sharepoint jenkins artifact-deployer


【解决方案1】:

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

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

是这样的:

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

如果你想使用 Jenkins 的变量,或者如下:

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

用您的实际密码替换。

  1. 最后,确保 Jenkins 用户对 SharePoint 文档库具有写入权限。 SharePoint 系统中有一些组将指示用户将拥有的权限类型。您可能需要自己的权利才能查看这些列表。只需确保将它们排成一行即可。

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-22
      • 2017-09-18
      • 2016-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多