Search code examples
jenkinskarma-runnerprotractorjobs

When do you have to make a new job in Jenkins


So I want to make a build-test-deploy environment in Jenkins: I want to do:

- a build 
- a karma test 
- a protractor test
- a deploy

Now a very simple but important question: Do I have to do everything in one job (what's possible) or do I have to split it up in several jobs (and cd (going) to the build directory?). So it isn't clear when I have to make a new job.


Solution

  • It is really a matter of taste and your exact needs.

    If you do not plan running build steps individually time after time (that is, if you only care about the build as an atomic piece), or if your build flow is simple and linear, it would make more sense to stick to a single job - this way you will keep all the configuration in one place and have a good overview of build results.

    If, however, there are different paths that the build process may take, or the steps themselves involve more complex logic, or, for instance, there is a need for collecting statistics on each of them, then it might be more beneficial to extract some of the steps to separate jobs and chain them together according to your rules. Jenkins is super-flexible and does not enforce any particular approach upon you.