Status: Open (View Workflow)
Environment:Jenkins Server: Windows 2012 R2, Jenkins 2.263.4, ssh-agent-plugin 1.22
Agents: jenkins/inbound-agent:4.3-4 Docker container running under Kubernetes client version 1.16.8 and server version 1.17.5
I have the following Jenkinsfile, executing in a Linux container under Kubernetes. My Jenkins server is version 2.263.4 running on Windows 2012 R2. Any variable I define in my environments section shows up in the sh action with a newline at the end:
Which results in this output:
As you can see, the PATH environment variable has no newline in the shell command, but the two variables from the Jenkinsfile have newlines at the end of their command and are surrounded by single quotes, even though they are surrounded by double-quotes in my sh command.
The problem happens when I use these values as parameters to other commands. For example:
ends up running this command:
This doesn't happen when I run on Windows. This step:
shows no newlines:
I don't have a non-container Linux on which to run, but at least one user reports it doesn't happen on Linux outside docker.