我有这个在詹金斯上运行的詹金斯文件
node("MacMiniSlave") {
try{
withEnv(["PATH=${env.HOME}/.rbenv/versions/2.3.1/bin:${env.PATH}","http_proxy=http://proxy.singaporepower.com.sg","https_proxy=http://proxy.singaporepower.com.sg","LANG=en_US.UTF-8","LANGUAGE=en_US.UTF-8"]){
sh "env"
echo "My branch is: ${env.BRANCH_NAME}"
}
currentBuild.result='SUCCESS'
}catch(Exception e){
currentBuild.result="FAILURE"
throw e
}finally{
step([$class: 'GitHubCommitNotifier', resultOnFailure:'FAILURE'])
}
}
但是这个的输出是My branch is: null
。为什么会这样?