title: Jenkins continuous integration and nightly builds
body: <p>I’m new to Jenkins and I like some help (reassurance) about how I think I should setup my jobs.</p>
  
  <p>The end goal is fairly simple.</p>
  
  <ul>
  <li><p><strong>Objective 1:</strong> When a developer commits code to a mercurial repo Jenkins pulls the changes, builds the project and runs the unit tests.  This happens continuously throughout the day so developers get the earliest possible feedback if they break something.</p></li>
  <li><p><strong>Objective 2:</strong> Nightly, Jenkins pulls the last stable build from above and runs automated UI tests.  If those tests pass it publishes the nightly build somewhere.</p></li>
  </ul>
  
  <p>I have a job configured that achieves objective 1 but I’m struggling with objective 2.
  (Not the publishing part, the idea of seeding this job with the last stable build of objective 1).</p>
  
  <p>At the moment, I’m planning to use branches in the HG repo to implement this.</p>
  
  <p>My branches would look something like Main >> Int >> Dev.</p>
  
  <p>The job in objective 1 would work on the tip of the Dev branch.
  If the build succeeds and the tests pass it would commit to the Int branch.</p>
  
  <p>The job in objective 2 could then simply work on the tip of the Int branch.</p>
  
  <p>Is this how it’s generally done?</p>
  
  <p>I’ve also been looking at/considering:
  - plugins like Promoted Builds and Copy Artifacts
  - parameterised builds
  - downstream jobs</p>
  
  <p>IMO my objectives are fairly common but I can’t find many examples of this approach online.  Perhaps it’s so obvious there was no need but I just wanted to check.</p>