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?

  • automated push to a github repo with travis
  • How can a commit in git submodule trigger a build in continuous integration?
  • How to use Jenkins to build multiple version of branches on master server?
  • Pre-commit hook for Git when Hudson build has failed
  • TeamCity push feature branches to master branch
  • git plugin and hudson
  • When I commit a project an extra project dir is created
  • Git: Undo local changes; git add . + git rm?
  • Git: how to deal with different shebang
  • A way to keep a shallow git clone just minimally up to date?
  • Branch descriptions in git
  • How can I tell git to ignore LibreOffice lock files?
  • 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.