How to build the latest git flow release branch in Jenkins?

I’m trying to set up continuous integration in Jenkins for git flow style development. I thought I would create three jobs to build RPM packages: for master, develop and the latest release branch.

The problem is with the latest release branch, as I’m not sure it is possible to setup builds so that Jenkins polls my git repo, and only does a build if the change ocurrs in the latest release/* branch. Is it more usual for people to clone jobs and hardcore branch names or can what I intend be done?

  • Testing/previewing Github branches on a dev server
  • Creating proper build or deployment chain with Microservices, Docker, Jenkins and GIT
  • Promote all builds to master on Jenkins
  • Jenkins CI Pipeline Scripts not permitted to use method groovy.lang.GroovyObject
  • How to pass a build number within the MultiJob plugin?
  • Jenkins, parameterized builds and the ability to select the required subprojects and child nodes based on variables
  • How to prevent rebase of certain branches, such as 'master'
  • How did these git commits get duplicated into the wrong branch?
  • Configure vsdiffmerge for multiple files at once
  • Git Workflow based on feature branches
  • Non-fast-forward error when pushing to git
  • Is it safe to interrupt a dcommit call that appears to be hung up?
  • One Solution collect form web for “How to build the latest git flow release branch in Jenkins?”

    If I understand correctly you are trying to see if there is a generic way to build branches in jenkins? (correct me if I am wrong)

    If thats what your trying to achieve, you can use parameterized builds. Make the branch name as a parameter.In jenkins configuration for the build, you can specify parameter name as BRANCH and reference that in your git clone command (i am assuming your using execute shell)

    git clone -b ${BRANCH}

    Now everytime you build, jenkins will prompt you for the branch name and you can specify values like origin/master or origin/release etc..

    Hope this helps

    Git Baby is a git and github fan, let's start git clone.