Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get Jenkins to skip failed branches till they change?

I'm using Jenkins with the Multiple SCMs + Git plugin. Jenkins is correctly doing a new build for each branch, but for some reason when it fails a build it just keeps trying to redo the build, even if the branch has not changed. How can I fix it so that Jenkins will move on to the next branch and only try to rebuild if the current branch changes?

like image 425
Frew Schmidt Avatar asked Apr 13 '12 15:04

Frew Schmidt


People also ask

How do I delete a Jenkins Branch job?

Simply delete the Jenkinsfile on the branch (es) you don't want to have corresponding branch jobs for. This will delete the branch job (of course, iff you have set your "Orphaned Item Strategy" appropriately). From the perspective of a Jenkins Multibranch Pipeline Project, this has the same effect as deleting the branch.

What happens if a Jenkins build is triggered by itself?

Any builds triggered will simply be skipped as SUCCESS, not having executed anything: . How to stop Jenkins unnecessarily kicking off builds on Multibranch pipelines when indexing the branches.

How do I build a solution in Jenkins using TFS?

I am using Jenkins to build a large .NET-based solution tied in to TFS. The first step in the script is to get the latest change sets from TFS, then build the solution. In some other tools I've used, there were options to skip the build if no new changes were found in TFS.

How to enable autoload on master branch in Jenkins pipeline?

So, finally wrap that thing into a nice library function, include the library on Jenkins at master level, enable autoload: Now you can use when in your scripted pipeline out of the box: echo 'Only on master branch.' stage ('My Conditional Stage') { when (BRANCH_NAME != 'master') { echo 'Only on master branch.'


1 Answers

I have seen similar behavior with my Jenkins jobs when I had the Delete Workspace plugin installed and the "Delete workspace after the build is complete" checkbox was checked in the job configuration. The git plugin apparently needs to have a workspace where it stores the information about the branches it has seen and tried to build. If the post-build action wipes the workspace, git plugin loses its state.

like image 84
sti Avatar answered Nov 15 '22 05:11

sti