-2

I have few scripts example (xcode.sh) which is in the mac agent. I would like to execute the script with 2 input Arguments. The user does not know the path to this script. How can i achieve this from VSTS Task

Say the script has to be executed like \usr\local\xcode "aaa" "bbb"

In Bamboo i do this with Executable and choose the executable in the Task

enter image description here

Community
  • 1
  • 1

1 Answers1

0

There is a Shell Script task that can specify Script path.

If the script file is in the current repository of build (Get source), you can click … button to select file, otherwise you need to specify the path manually.

Regarding arguments, you can specify it in Argument input box.

enter image description here

Update:

You can custom build task to define an input with picklist type, simple sample:

 "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"
            }
        }
}

Regarding custom build task, you can refer to Add a build task

You can retrieve the data from server (e.g. web api) and populate to that input box.

Some threads to bind source.

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

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

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53