title: Jenkins Build and Deploy
body: <p>I am learning Jenkins. Can someone tell me if my understanding is correct?</p>
  
  <p>To build the app:</p>
  
  <ul>
  <li>I commit my code and push my branch to my remote repository. </li>
  <li>Jenkins sees my commit and triggers off a build (possibly using maven install). </li>
  <li>Jenkins runs all the tests and if all pass, a war/ear is created. This artefact is pushed to nexus.</li>
  </ul>
  
  <p>To deploy to an environment:</p>
  
  <ul>
  <li>A deploy script in my branch contains steps to deploy the app to, say, Tomcat.
  Jenkins goes to Nexus, retrieves the latest artefact (built above), and deploys this app to Tomcat.</li>
  <li>Other steps in the deploy file shutdown and restart Tomcat as necessary, possibly testing to make sure the app started and is ready to serve requests.</li>
  </ul>
  
  <p>Am I right in saying that a deploy doesn't need to build the latest artefact, that it uses that last one pushed to Nexus, or is a fresh one built every deploy?</p>