2017-07-14 194 views
-2

我有几个脚本示例(xcode.sh),它位于mac代理中。我想用2个输入参数执行脚本。用户不知道此脚本的路径。如何从VSTS任务实现这一如何在VSTS中执行脚本

说出脚本有类似的\ usr \本地\ Xcode的“AAA”执行对象“BBB”

在竹我这样做具有可执行,并选择在任务可执行

enter image description here

回答

0

没有可以指定脚本路径Shell脚本任务。

如果脚本文件位于build(Get source)的当前存储库中,则可以单击...按钮选择文件,否则需要手动指定路径。

关于参数,您可以在参数输入框中指定它。

enter image description here

更新:

您可以自定义生成任务定义与选择列表类型的输入,简单的示例:

"inputs": [ 
     { 
      "name": "ConnectedServiceName", 
      "type": "connectedService:AzureRM", 
      "label": "Azure subscription", 
      "defaultValue": "", 
      "required": true, 
      "helpMarkDown": "Select the Azure Resource Manager subscription" 
     }, 
     { 
      "name": "Action", 
      "type": "pickList", 
      "label": "Action", 
      "required": false, 
      "helpMarkDown": "Action to be performed on the App Service. You can Start, Stop, Restart, Slot swap or Install site extensions for an Azure App Service", 
      "defaultValue": "Swap Slots", 
      "options": { 
       "Swap Slots": "Swap Slots", 
       "Start Azure App Service": "Start App Service", 
       "Stop Azure App Service": "Stop App Service", 
       "Restart Azure App Service": "Restart App Service", 
       "Install Extensions": "Install Extensions" 
      } 
     } 
} 

关于自定义生成任务,你可以参考Add a build task

您可以从服务器(例如web api)检索数据并填充到该输入框。

一些线程绑定源。

How to display “Area path” in VSTS build task input PickList?

Use the ServiceEndpoinr.Uri as/in the SourceDefinition.Endpoint

+0

非常感谢您的回复。用户不知道脚本路径。它应该可以显示在下拉菜单中,只需选择其中一个即可。 –

+0

@KarthikeyanKulasekaran我更新了我的答案。您可以自定义构建任务,内置任务不符合您的要求。 –

+0

非常感谢您的反馈。我会试试这个 –