user3557972
user3557972

Reputation: 35

How to manipulate the status of current job-execution from inside of an inline script?

The following code returns an error to rundeck.

#!/bin/bash
exit -1

And rundeck decides how to deal with it by running the next step or changing the execution "status" to "failed".

I would like to modify the status directly by inline script to support more than 2 states. I need "succeeded", "failed" and "nodata" to express that the data are missing.

Is there a way to express this?

Upvotes: 0

Views: 1235

Answers (1)

Yang
Yang

Reputation: 888

There is none. Just like bash can return zero or non-zero

One possible alternative is raise an exception with message nodata and exit with non-zero code. Rundeck will mark this job as fail with NonZeroResultCode error. You should be able to get your error message nodata with ${result.message}

Upvotes: 1

Related Questions