Jenkins 流水线语法进阶 06 条件语句 if语句
/*
定义变量参数branchName
如果branchName 等于dev则打印dev,
如果branchName 等于test则打印test,
上面都不匹配则打印skipdeploy
*/
String branchName = "dev"
if ( branchName == "dev" ){
println("dev....")
} else if (branchName == "test"){
println("test....")
} else {
println("skipdeploy......")
}
目录 返回
首页