将构建工件从 Jenkins Pipeline 上传到 Sharepoint

Gou*_*nda 1 sharepoint jenkins jenkins-pipeline

我需要在构建结束时将构建工件上传到 SharePoint。使用詹金斯管道。

我没有找到任何插件来实现这一点。

我的 Jenkins 实例在 Linux 机器上运行。请建议实现此目标的最佳方法

Nik*_*lay 5

我正在使用适用于 Microsoft 365 的 CLI(也适用于 Linux)。看起来有点像这样:


m365 login --authType password --userName user@contoso.com --password pass@word1

m365 spo file add --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents' --path 'C:\MS365.jpg'
Run Code Online (Sandbox Code Playgroud)

https://pnp.github.io/cli-microsoft365/cmd/login/

https://pnp.github.io/cli-microsoft365/cmd/spo/file/file-add/

您可能需要为您的 jenkins 添加特殊帐户到您的共享点,或者添加应用程序密码才能从守护进程进程上传文件(如果您的共享点需要 MFA 身份验证)