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
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
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
Most helpful comment
You need to use the | operator in YAML to indicate that newlines should be preserved.
eg.
See https://stackoverflow.com/a/21699210/25702 for more info.
Would be good to mention this in the documentation