-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command arguments Quotations not visible in Linux agent logs #383
Comments
I looked at code https://github.com/Microsoft/vsts-task-lib/blob/f22b24bd393becbb370b95f394e3f2cdcc823964/node/toolrunner.ts , looks like for linux, quotations not handled like windows. |
I can't say for sure, but if you are passing that in as a string it could be an issue with _argStringToArray. If so, passing something like docker run -t my-container sh -c If that doesn't resolve it, I'll take a deeper look - I'm somewhat confused as to why it would work with Windows and not Linux |
I'm going to close, please reopen if appropriate. |
I'm not sure if it's the right place to report this, but escaping seems to be inconsistent: Here is the Docker task I'm using in the classic release pipeline:
As you can see, I'm trying to pass a JSON as string (all other arguments are omitted for clarity) and it's not escaped correctly when task is run:
|
I am using docker run task to execute a one liner script in a container just build in the pipeline. The idea is to execute:
docker run -t my-container sh -c "ls .Test/.csproj | xargs -L1 dotnet test -c Release --logger:trx -r ../../test_out"
So I set up a docker run task and pass sh -c "ls .Test/.csproj | xargs -L1 dotnet test -c Release --logger:trx -r ../../test_out" in the field Command.
To my surprise, the double quotes disappear and there fore the actual command executed by the agent is (from the task output)
docker run -t my-container sh -c ls .Test/.csproj | xargs -L1 dotnet test -c Release --logger:trx -r ../../test_out
There is no failure in executing command, just quotation not visible in logs.
In windows agent, logs showing properly. docker run -t my-container sh -c "ls .Test/.csproj | xargs -L1 dotnet test -c Release --logger:trx -r ../../test_out"
The text was updated successfully, but these errors were encountered: