简体   繁体   English

需要将一个 VSTS Build 任务的引用添加到另一个任务

[英]Need to add reference from one VSTS Build task to another task

I am working on creating custom vsts build task using Hosted agent and powershell script.我正在使用托管代理和 powershell 脚本创建自定义 vsts 构建任务。 I just want to add reference of existing task available out of the box in vsts (Publish Build Artifacts).我只想在 vsts(发布构建工件)中添加现成可用的现有任务的引用。 Is there any way to reference this task in our custom task?有没有办法在我们的自定义任务中引用这个任务? Or I just have to implement the functionality provided by PublishBuildArtifacts manually?或者我只需要手动实现 PublishBuildArtifacts 提供的功能?

The way to reference another task us to grab the sources from the Task Repository on GitHub and package them with your own task (in a subfolder).引用另一个任务的方法是我们从 GitHub 上的任务存储库中获取源代码并将它们打包到您自己的任务中(在子文件夹中)。 You'll need to copy the inputs from their task.json and merge them into yours if you want to allow other users to configure the fields exactly the same way as the other task is doing.如果您想允许其他用户以与其他任务完全相同的方式配置字段,您需要从他们的 task.json 复制输入并将它们合并到您的。

You can find the task implementations here: https://github.com/Microsoft/vsts-tasks make sure you select the right branch, the master branch is the bleeding edge, and it may contain a version of the tasks that is not fully battle tested or may not be compatible with the latest version of the agent that has been released (or the minimal agent version you are targeting).你可以在这里找到任务实现: https : //github.com/Microsoft/vsts-tasks确保你选择了正确的分支,master 分支是最前沿的,它可能包含一个不完整的任务版本经过实战测试或可能与已发布的最新代理版本(或您所针对的最小代理版本)不兼容。

Or you can grab the implementation from a build agent's tasks directory.或者您可以从构建代理的任务目录中获取实现。

Remember that for certain functionality, the VSTS Task SDK has built-in methods to upload artefact, which may make your life easier if you decide to implement the functionality on your own.请记住,对于某些功能,VSTS 任务 SDK 具有上传人工制品的内置方法,如果您决定自己实现这些功能,这可能会让您的生活更轻松。

The team that built the agent has been pretty specific about making sure that tasks are self-contained and need to package their own dependencies or flag a demand.构建代理的团队非常明确地确保任务是自包含的,并且需要打包自己的依赖项或标记需求。 This is to ensure that each task can evolve and change independently.这是为了确保每个任务都可以独立发展和变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 可以在基于PowerShell的VSTS构建任务中使用ExtensionDataService吗? - Can ExtensionDataService be used from a PowerShell-based VSTS build task? 如何在VSTS构建任务中使用自定义Powershell模块 - How to use a custom Powershell module in a VSTS build task 调用PhantomJS的自定义VSTS构建任务无法创建映像文件 - Custom VSTS Build Task to Call PhantomJS Fails to Create Image File VSTS:将构建/发布变量传递到 Powershell 脚本任务中 - VSTS: Pass build/release variables into Powershell script task VSTS任务组Powershell参数 - VSTS Task Group Powershell Parameter 将Powershell脚本作为VSTS中的任务运行 - run a powershell script as a task in VSTS 在 Azure Devops 中使用从一个 PowerShell 任务到另一个任务的变量值 - use variable value from one PowerShell task to another in Azure Devops 是否可以从正在运行的另一个任务调度程序调用一个任务调度程序 - Is it possible to call one task scheduler from another task scheduler which is running Azure Devops - 从一个任务输出 Json 对象并在另一任务中使用 - Azure Devops - Output Json Object from one task and Consume in another task TFS | VSTS - 自定义构建任务执行无法找到VstsTaskSdk.psd1 - TFS | VSTS - Custom Build Task execution cannot find VstsTaskSdk.psd1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM