Re: WorkflowMultiBranchProject getLastBuild

2016-08-09 Thread Sverre Moe
> > On Mon, Aug 8, 2016 at 4:31 AM, Sverre Moe > wrote: > > I just need the last build from an upstream dependency. The upstream > build > > cause might be an upstream dependency, or it may be an SCM cause. Such > that > > the upstream project might not be the upstream

Re: WorkflowMultiBranchProject getLastBuild

2016-08-08 Thread Jesse Glick
On Mon, Aug 8, 2016 at 4:31 AM, Sverre Moe wrote: > I just need the last build from an upstream dependency. The upstream build > cause might be an upstream dependency, or it may be an SCM cause. Such that > the upstream project might not be the upstream cause. Also an

Re: WorkflowMultiBranchProject getLastBuild

2016-08-08 Thread Sverre Moe
It is related somewhat. That issue is about getting the upstream build that triggered this running build. I just need the last build from an upstream dependency. The upstream build cause might be an upstream dependency, or it may be an SCM cause. Such that the upstream project might not be the

Re: WorkflowMultiBranchProject getLastBuild

2016-08-05 Thread Jesse Glick
On Fri, Aug 5, 2016 at 4:02 AM, Sverre Moe wrote: > Variable currentBuild irefers to the currently running build. What I needed > was the last build of a upstream dependency. Like JENKINS-31576 you mean? -- You received this message because you are subscribed to the

Re: WorkflowMultiBranchProject getLastBuild

2016-08-05 Thread Sverre Moe
Pipeline Syntax -> Global Variables Reference Variable currentBuild irefers to the currently running build. What I needed was the last build of a upstream dependency. org.jenkinsci.plugins.workflow.job.WorkflowJob job = anotherUpstreamProject. getAllJobs().first()

Re: WorkflowMultiBranchProject getLastBuild

2016-08-04 Thread Jesse Glick
On Wed, Aug 3, 2016 at 5:14 AM, Sverre Moe wrote: > I need to get the latest build job in my Groovy build script. Did you look at the documentation under Global Variables for `currentBuild`? -- You received this message because you are subscribed to the Google Groups

Re: WorkflowMultiBranchProject getLastBuild

2016-08-03 Thread Sverre Moe
With some experimenting I think I have gotten what I need. def jenkinsInstance = jenkins.model.Jenkins.getInstance() def jenkinsProject = "multiBranchPipelineProjectA/master" def project = jenkinsInstance.getItemByFullName(jenkinsProject) def job = project.getAllJobs().first() def lastBuild =

WorkflowMultiBranchProject getLastBuild

2016-08-03 Thread Sverre Moe
Have Jenkins projects as Multibranch pipeline: org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject extends jenkins.branch.MultiBranchProject extends com.cloudbees.hudson.plugins.folder.computed.ComputedFolder extends com.cloudbees.hudson.plugins.folder.AbstractFolder