Re: Is it possible to schedule a build inside a JenkinsFile?

2018-12-26 Thread Vincent Massol
Thanks Baptiste. I'll detail the XWiki use case. What we have: * https://ci.xwiki.org/view/Recommended%20Builds/ * We are using a GitHub Organization job type. * We have Jenkinsfiles in each repo of the GitHub organization, which all use a shared global pipeline library (see https://github.com

Re: Is it possible to schedule a build inside a JenkinsFile?

2018-12-25 Thread Baptiste Mathus
Hey Vincent, I'm still unsure if fully understood what you're trying to achieve. IIUC, for that stage that should happen only once a day, I guess it depends. If something gets created there, like an artifact, could you maybe simply check the timestamp of this artifact, and check it's at least 24

Re: Is it possible to schedule a build inside a JenkinsFile?

2018-12-25 Thread Vincent Massol
Thanks a lot Slide. That's an interesting strategy. The problem I see is that we have several crons (and the cron frequencies are configurable). So ideally we would need to pass some variable alongside the cron trigger so that we could check which cron was triggered and build accordingly. Appa

Re: Is it possible to schedule a build inside a JenkinsFile?

2018-03-28 Thread Slide
I do this by checking the thing that caused the build: @NonCPS def findBuildType(build) { def causes = build.causes def isHourly = causes.any { it -> (it instanceof hudson.model.Cause.UserIdCause) || (it.class.name.toLowerCase().contains( 'gitlab')) } return isHourly ? "Hourly" : "Daily" } We us

Is it possible to schedule a build inside a JenkinsFile?

2018-03-28 Thread Vincent Massol
Hi guys, On XWiki we have a Jenkins pipeline committed in our SCM (in a Jenkinsfile) which looks like this: def globalMavenOpts = '-Xmx1536m -XX:MaxPermSize=512m -Xms256m' stage ('Commons Builds') { parallel( 'main': { node { // Build, skipping quality checks so that the res