0

I have a project that uses a template:

Extracted relevant part of the template:

parameters:
  - name: buildArguments
    type: string
    default: 'here are my default build arguments'
  - task: DotNetCoreCLI@2
    displayName: 'Build'
    inputs:
      command: 'build'
      configuration: '${{ parameters.buildConfiguration }}'
      arguments: '${{ parameters.buildArguments }}'
      projects: |
        ${{ parameters.buildProjectNames }}

I want to keep the default buildArguments string and just concatenate/add project specific parts to it. How can I do that?

Part of my project pipeline

- template: build/templates/MyTemplate.yml@templates
  parameters:
    buildArguments: defaultvalue + myProjectSpecificArgumentsHere

1 Answer 1

1

You can use the join expression:

arguments: ${{ join('DEFAULT-VALUE',parameters.buildProjectNames) }}

(remove the default value from the parameters).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.