Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore certain exit codes in GitLab CI pipeline script

Tags:

bash

gitlab-ci

I have a script in GitLab CI but one command sometimes ends with exit code 101 what is OK in my use case and I want to ignore it.

I would use true:

failing_script || true

But it will ignore all exit codes, so I will not be notified when there will be some other error.

I would need something like this:

failing_script || (true only if exit code 101)
like image 782
Bobík Avatar asked Oct 16 '25 15:10

Bobík


1 Answers

This seems to be what you're looking for:

failing_script|| [ $? -eq 101 ]
like image 63
Frumpled Biscuit Avatar answered Oct 18 '25 14:10

Frumpled Biscuit