sharepoint - Jenkins 发布到 SharePoint

标签 sharepoint jenkins artifact-deployer

我正在处理一个需要将 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

最佳答案

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

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

  • 是这样的:
    net use Q: \\Server\files < password > /User:<username>
    或者,如果您想使用 Jenkins 的变量,请执行以下操作:
    net use Q: \\Server\files < password > /User:%USERNAME%
    替换为您的实际密码。
  • 最后,确保 Jenkins 用户对 SharePoint 文档库具有写入权限。 SharePoint 系统中有一些组将指示用户将拥有何种权限。您可能需要自己的权限才能查看这些列表。只要确保它们排成一排。
  • 关于sharepoint - Jenkins 发布到 SharePoint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36043129/

    相关文章:

    maven - 我想获取 Jenkins 部署的神器版本

    c# - SharePoint 列表项权限

    c# - 根据 GUID 获取站点 URL? (分享点)

    javascript - Highcharts 不在 Internet Explorer 11 中呈现

    jenkins - 如何从 Jenkins 声明式管道中替换 Artifactory File Spec "Spec Vars"

    html - SP2010 - 更改列表列的宽度,或使用 CSS 设置最大宽度

    jenkins - 如果我取消选中“不带参数构建”,参数化触发器不会触发下游作业,为什么

    junit - 由于 NoClassDefFoundError - ParseResultCallable,Jenkins 无法生成测试报告

    java - 将本地Maven存储库上传到Archiva