Hi all,

I'm using the pipeline model definition plugin (which is great btw!) to 
specify my pipelines.  I have a question about trigger though.  I'd like to 
use a poll based trigger instead of cron, but it's not clear on if it is 
supported.  Can anyone provide any feedback?

Here's the example from the wiki 
<https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/Trigger-runs>
:

pipeline {
    agent any

    triggers {
        cron '@daily'
    }

   ...
}


Instead of cron, I want to poll.  Unless I misunderstand, cron will 
definitely cause a build daily in the above configuration.  Instead, I'd 
like to configure Jenkins polling once a day instead.  This is necessary in 
my situation because push based triggers from my SCM don't actually trigger 
anything unless the Jenkins job is already set up to poll.  Specifically, 
I'm talking about what is the 'Poll SCM' build trigger from the gui panel.

I went ahead and tried poll as a trigger, but as you can see, that is not 
supported.  Supported methods within a triggers closure appear to be:

[Pipeline] End of Pipelinejava.lang.NoSuchMethodError: No such DSL method 
'poll' found among steps [VersionNumber, archive, bat, build, catchError, 
checkout, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, 
dockerLabel, echo, envVarsForTool, error, fileExists, getContext, git, input, 
isUnix, libraryResource, load, mail, milestone, node, parallel, properties, 
pwd, readFile, readTrusted, retry, script, sh, sleep, sshagent, stage, stash, 
step, svn, timeout, tool, unarchive, unstash, waitUntil, withContext, 
withDockerContainer, withDockerRegistry, withDockerServer, withEnv, withMaven, 
wrap, writeFile, ws] or symbols [all, always, any, apiToken, architecture, 
archiveArtifacts, artifactManager, batchFile, booleanParam, buildButton, 
buildDiscarder, caseInsensitive, caseSensitive, choice, choiceParam, clock, 
cloud, command, configFile, configFileProvider, cron, crumb, defaultView, 
demand, disableConcurrentBuilds, docker, downloadSettings, downstream, dumb, 
envVars, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, 
freeStyleJob, git, hyperlink, hyperlinkToModels, installSource, jdk, 
jdkInstaller, jgit, jgitapache, jnlp, jobDsl, jobName, junit, label, 
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, pipeline-model, 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, docker, env, params, pipeline, scm]

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2bc83b22-bec6-4dca-97cf-4147d5144364%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to