Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to make Jenkins ignore stderr?

Tags:

stderr

jenkins

I have a jenkins ci job that runs some shell commands (linux). Specifically I'm cd-ing into a git repo and using git add remote to make sure the remote is set before running other commands. Typically the remote is still there and there's stderr output saying "fatal: remote foo already exists" which is fine by me, but mr. Jenkins halts the job and marks it as failed.

How can I tell Jenkins to ignore this stderr or that it's expected? Or is there a smarter approach to this?

Thanks in advance.

like image 221
Jorge Orpinel Pérez Avatar asked Feb 01 '26 06:02

Jorge Orpinel Pérez


1 Answers

git add remote git_repo || true

this will return a 0 exit status

like image 83
Keeto Avatar answered Feb 03 '26 06:02

Keeto