小编rig*_*tod的帖子

jenkins管道中的变量

为了使我的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)

groovy jenkins jenkins-pipeline

5
推荐指数
1
解决办法
8727
查看次数

标签 统计

groovy ×1

jenkins ×1

jenkins-pipeline ×1