I am learning Jenkins. Can someone tell me if my understanding is correct?
To build the app:
- I commit my code and push my branch to my remote repository.
- Jenkins sees my commit and triggers off a build (possibly using maven install).
- Jenkins runs all the tests and if all pass, a war/ear is created. This artefact is pushed to nexus.
To deploy to an environment:
- 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.
- 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.
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?