title: Integration-Manager Git Workflow using Jenkins/Hudson
body: <p>I'm trying to  implement a modified Integration-Manager workflow similar to what's described in <a href="http://progit.org/book/ch5-1.html" rel="noreferrer">ProGit</a>.</p>
  
  <p><img src="https://i.stack.imgur.com/2LIYg.png" alt="Diagram of the Integration-Manager workflow"></p>
  
  <p>Instead of an <code>integration manager</code> performing the merges, I want developers to merge locally before publishing their code, and I want a <code>Quality Gateway</code> that enforces our continuous integration standards, such as a minimum level of code coverage and 100% tests passing, before allowing code to enter the blessed repository to be checked out by other developers. The idea is that the code in the blessed repository always meets the minimum standard we define and always builds.</p>
  
  <p>I want Jenkins to perform the role of the quality gateway, only pushing code to the blessed repository when builds succeed.</p>
  
  <p>So far, I have set up the system so that there are the following public repos: the blessed repository, a repository on the build server for Jenkins, which is a bare repo accessed through gitosis, and of course developer's own repositories.</p>
  
  <p>I have developers pulling from the blessed repo and pushing to the integration repo. Now I'm trying to get Jenkins to push successful builds from the integration repo to the blessed repo.</p>
  
  <p>So far, the only option I've seen that seems similar to what I'm trying to achieve is the "<code>Push Only If Build Succeeds</code>" option in the Git Publisher settings of the Post Build Actions in Jenkins' project configuration. However, that options doesn't allow you to specify the push url or remote to push to.</p>
  
  <p>As I understand it, the Git Publisher settings would push the repo Jenkins' clones into its workspace back into Jenkins' public repo, but I want to push to a different remote, the blessed repository.</p>
  
  <p><strong>Does anyone have any suggestions how I can get Jenkins to push to the blessed repo?</strong></p>
  
  <p><strong>EDIT 0</strong>:
  I tried putting a Post Step to execute the push command to my blessed repository. This appears to work, in that there are no errors. However no changes are being pushed and the logs show that git thinks everything is up to date:</p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------ 
  [INFO] BUILD SUCCESSFUL 
  [INFO]     ------------------------------------------------------------------------ 
  [INFO] Total time: 1 minute 7 seconds 
  [INFO] Finished at: Fri Nov 18 16:10:50 UTC 2011 
  [INFO] Final Memory: 19M/45M 
  [INFO] ------------------------------------------------------------------------ 
  channel stopped 
  [My Project] $ /bin/sh -xe /tmp/hudson5604254372179801803.sh + git push git@example.com:my-project.git --all
  Everything up-to-date
  </code></pre>
  
  <p>I don't know why git thinks there's nothing to push, because there definitely is.</p>