Shell使用Jenkins的boolean值

1
2
3
4
#!/bin/bash
if ! [[ $SKIP_TESTS == true ]] ; then
#Do something if condition match
fi
1
2
3
4
5
6
#!/bin/bash
GRAY_MODE=false
availabilityZone=ap-southeast-1c
if [[ $GRAY_MODE = true && "$availabilityZone" = "ap-southeast-1c" || $GRAY_MODE = false && "$availabilityZone" = "ap-southeast-1a" ]] ; then
#Do something if condition match
fi

===功能一致,但是如果使用=判断,=号两边必须加空格,否则认为是赋值语句