使用jenkins管道插件中的检查点重新启动构建时出错

时间:2016-10-24 10:56:18

标签: jenkins jenkins-pipeline

我想在jenkins-pipeline-plugin中使用检查点重新开始。

我安装了workflow-cps-checkpoint.hpi插件。

这是我的groovy脚本:

checkpoint 'task1'
stage 'task1'

node('agent'){
  echo 'executing task1'
  sleep 20
}

checkpoint 'task2'
stage 'task2'

node('agent'){
  echo 'executing task2'
  sleep 20
}

运行构建时出现以下错误:

java.lang.NoSuchMethodError: No such DSL method 'checkpoint' found among steps [archive, bat, build, catchError, checkout, deleteDir, dir, echo, error,
fileExists, input, isUnix, libraryResource, load, mail, milestone, node, parallel, properties, pwd, readFile, readTrusted, retry, sh, sleep, stage,
stash, step, timeout, tool, unarchive, unstash, waitUntil, withEnv, wrap, writeFile, ws] or symbols [all, always, ant, antFromApache, antOutcome,
antTarget, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanParam, buildButton, buildDiscarder, caseInsensitive,
caseSensitive, choice, choiceParam, clock, cloud, command, cron, crumb, defaultView, demand, disableConcurrentBuilds, downloadSettings, downstream,
dumb, envVars, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, git, hyperlink, hyperlinkToModels, installSource,
jdk, jdkInstaller, jgit, jnlp, jobName, junit, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, list, local, 
location, logRotator, loggedInUsersCanDoAnything, masterBuild, maven, maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, myView, nodeProperties,
nonStoredPasswordParam, none, overrideIndexTriggers, paneStatus, parameters, password, pattern, pipelineTriggers, plainText, plugin, 
projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, run, runParam, schedule, scm, scmRetryCount, search, security, shell, slave,
stackTrace, standard, status, string, stringParam, swapSpace, text, textParam, tmpSpace, toolLocation, unsecured, upstream, viewsTabBar, weather, 
zfs, zip] or globals [currentBuild, env, params, scm]

at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:149)

at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)

1 个答案:

答案 0 :(得分:2)

您显示的错误消息表示没有安装提供checkpoint关键字的插件。

workflow-cps-checkpoint插件不是开源Jenkins的一部分;它是公司CloudBees提供的闭源功能。如果您是他们的客户,您应该联系他们的支持。

然而,CloudBees已经表示他们plan to open-source the plugin在某些时候。