Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

azure pipeline multiline script

steps:

- script: |
    echo "good"
    echo "nice"

This doesn't work. It prints 'good' successfully, but doesn't print nice and shows echo "nice" so the final output is

good echo 'nice'

I tried to remove | after the script: but still no luck. Any idea? I am running this on ubuntu machine.

like image 780
Nika Kurashvili Avatar asked Feb 25 '20 09:02

Nika Kurashvili


1 Answers

I get the desired output. This is how my pipeline looks like:

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

steps:
- script: |
    echo "good"
    echo "nice"

Output:

enter image description here


Answer to the question in the comments:

This is how I pass multiple parameters to the ARM deployment task:

steps:
  - task: AzureResourceManagerTemplateDeployment@3
    displayName: "MyDeployment"
    inputs:
      deploymentScope: "Resource Group"
      ConnectedServiceName: ${{ parameters.serviceConnection }}
      action: "Create Or Update Resource Group"
      resourceGroupName: "$(resourceGroupName)"
      location: "$(location)"
      templateLocation: "Linked artifact"
      csmFile: "$(Pipeline.Workspace)/drop/azuredeploy.json"
      overrideParameters: "
        -eventGridTopicName myEventGridName
        -appServicePlanName myAppServicePlan"
      deploymentMode: "Incremental"
like image 130
Martin Brandl Avatar answered Sep 18 '22 07:09

Martin Brandl