【jenkins】pipeline语法,使用if语句判断分支, 下载代码
1. 流水线语法
node { stage('Example') { if (env.BRANCH_NAME == 'master') { echo 'I only execute on the master branch' } else { echo 'I execute elsewhere' } } }
2. 官网地址
https://www.jenkins.io/doc/book/pipeline/syntax/