Loops and conditionals
One of the weaker things in bash are the conditionals, when compared to the simplicity and elegance of a higher language. I know the syntax of both and there are many, many caveats in the bash conditionals that make them non-trivial.
Example 1#
def var1 = true
node{
stage('HW1a'){
if(var1){
echo 'hello world'
}
}
stage('HW1b'){
if(!var1){
echo 'failure'
} else {
echo 'another hello world'
}
}
}
output:
hello world
another hello world