为了使我的jenkins管道定义文件更具可定制性,我尝试使用最多的变量.
当我尝试在邮件或步骤指令中使用变量jenkins抛出此错误:
java.lang.NoSuchMethodError: No such DSL method '$' found among [archive, bat, build, catchError, checkout, deleteDir, dir, echo, emailext, emailextrecipients, error, fileExists, git, input, isUnix, load, mail, node, parallel, properties, pwd, readFile, readTrusted, retry, sh, sleep, stage, stash, step, svn, timeout, timestamps, tool, unarchive, unstash, waitUntil, withCredentials, withEnv, wrap, writeFile, ws]
Run Code Online (Sandbox Code Playgroud)
这是我的jenkins pipleline定义文件:
#!groovy
node {
//Define job context constants
def projectName = "JenkinsPipelineTest"
def notificationEmailRecipients = "aaa@domain.com"
def notificationEmailSender = "bbb@domain.com"
currentBuild.result = "SUCCESS"
//Handle …Run Code Online (Sandbox Code Playgroud)