将构建项目发布到 OneDrive

Publish build artifacts to OneDrive

是否可以将 Visual Studio Team Services 上的构建输出发布到 OneDrive 存储?在我的例子中,它将是 VSTS 项目所有者的 OneDrive。

不,您可以通过发布构建工件任务直接发布。

发布构建工件任务仅支持两种类型:

Server: store artifacts in team services.

File share: copy artifacts to a file share that must be accessible from the build agent.

  • 如果您有本地文件夹要与 onedrive 同步

    您可以通过这些设置使用复制文件任务:

    源文件夹:$(build.sourcesdirectory)

    目标文件夹:与onedirve库同步的本地路径。

  • 如果您没有要与 onedrive 同步的本地文件夹

    您可以使用power shell脚本任务来upload file/folders by REST API

您还可以在构建定义中添加 PowerShell 脚本任务,以通过 PoswerShell 将文件上传到 OneDrive。 PowerShell脚本可以参考这个link:How to upload large file to OneDrive by Rest API via Powershell.