[JIRA] (JENKINS-57149) Shell redirect causes exit code 0

3 views
Skip to first unread message

shadycuz@gmail.com (JIRA)

unread,
Jul 2, 2019, 10:21:02 AM7/2/19
to jenkinsc...@googlegroups.com
Levi Blaney updated an issue
 
Jenkins / Bug JENKINS-57149
Shell redirect causes exit code 0
Change By: Levi Blaney
Summary: Shell redirect causes exit code 0 on official docker Jenkins
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

shadycuz@gmail.com (JIRA)

unread,
Jul 2, 2019, 10:23:02 AM7/2/19
to jenkinsc...@googlegroups.com
Levi Blaney updated an issue
When using the official Jenkins docker container `jenkins/jenkins` or `jenkins/jenkins:lts`, running Running a `sh()` step that has `&>` or any redirect causes the command to work even if the command should fail. It also doesn't appear that the command is running at all. 

So `sh('notacommand &> test.log')` outputs the `command not found` error to the console instead of the file. Creates an empty `test.log` and the build passes even though it should have failed.


I had originally created this bug as a docker issue but I'm seeing it on our updated AWS instances as well.

shadycuz@gmail.com (JIRA)

unread,
Jul 2, 2019, 10:28:03 AM7/2/19
to jenkinsc...@googlegroups.com
Levi Blaney updated an issue
Running a `sh()` step that has `&>` or any redirect causes the command to work even if the command should fail. It also doesn't appear that the command is running at all. 

So `sh(' notacommand FakeNews  &> test.log')` outputs the `command not found` error to the console instead of the file. Creates an empty `test.log` and the build passes even though it should have failed. But `sh('FakeNews')` causes exception FakeNews: command not found. This is a more recent issue (last 4 months or so) didn't see this before that.

I had originally created this bug as a docker issue but I'm seeing it on our updated AWS instances as well.
Reply all
Reply to author
Forward
0 new messages