Azure-devops-docs: Multiple Docker Compose File Args not parsing through

Created on 21 Feb 2019  Â·  2Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

We're trying to parse in multiple variables into a docker compose task using the dockerComposeFileArgs flag. So far, the first argument will contain the contents of the other key value pairs despite the documentation saying seperate using a new line.

example:

   variables:
      firstArg=first_arg
      secondArg=second_arg
- task: DockerCompose@0
  displayName: 'Container build'
  inputs:
      .
      .
      .
     dockerComposeFileArgs: 
        firstArg=$(firstArg)
        secondArg=$(secondArg)

Which will put everything into the first argument.

RUN echo $firstArg
> first_arg secondArg=second_arg

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 devops-cictech devopprod doc-bug

Most helpful comment

You need to use the | operator in YAML to indicate that newlines should be preserved.

eg.

dockerComposeFileArgs: |
  firstArg=$(firstArg)
  secondArg=$(secondArg)

See https://stackoverflow.com/a/21699210/25702 for more info.

Would be good to mention this in the documentation

All 2 comments

You need to use the | operator in YAML to indicate that newlines should be preserved.

eg.

dockerComposeFileArgs: |
  firstArg=$(firstArg)
  secondArg=$(secondArg)

See https://stackoverflow.com/a/21699210/25702 for more info.

Would be good to mention this in the documentation

The documentation has been updated. Thank you for the feedback. If you see anything else, feel free to open a new issue

Was this page helpful?
0 / 5 - 0 ratings