Manual fail of task #430
-
I want to fail task when the command successfully executed and based on the output of the script. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Narsimha1997 👋 One possible way to accomplish this is with the following YAML code: steps:
- name: s1
command: echo valid
output: RESULT
- name: s2
command: "sh"
script: |
echo result=$RESULT
if [ "$RESULT" != "valid" ]; then
exit 1
fi
depends:
- s1 I was thinking that it would be great to add more versatile condition capabilities, such as the ability to specify preconditions like the one in this example where we check if the result is not equal to "valid". steps:
- name: s1
command: echo valid
output: RESULT
- name: s2
command: "false" # fail
preconditions:
- condition: "$RESULT"
predicate: "!="
expected: "valid"
depends:
- s1 |
Beta Was this translation helpful? Give feedback.
Hi @Narsimha1997 👋
One possible way to accomplish this is with the following YAML code:
I was thinking that it would be great to add more versatile condition capabilities, such as the ability to specify preconditions like the one in this example where we check if the result is not equal to "valid".