Search code examples
gitjenkinscontinuous-integrationjenkins-pluginspipeline

Jenkins CI configuration: Build/test/deploy scenarios


My goal: set up a Jenkins-server capable of pulling down our github repos and run through the build-deploy-test scenarios.

So I have set up a Jenkins-server. But I don't understand how I have to run through the build-deploy-test scenarios of my project.

My project contains 1 repository which I putted into a job. I have installed the Build Pipeline Plugin. Will this be enough? It's difficult for me to understand the set-up. How do I have to start?


Solution

  • Let's say you want to have a build-deploy-test scenario using the folowing:

    • Unit-tests
    • Acceptance tests
    • Code coverage and static analysis
    • Deployment to integration environment

    First of all, You need to have one job for each case. For example your create a job that runs JUnit tests, a job that runs selenium tests for AT, a job that runs Sonar code checks for static analysis and checkmarx for security checks and finaly a job that deploys your app to tomcat.

    Then, you need your jobs to run one after the other so what you do is that you set the 2nd job in the post build of the 1st, the 3rd in the post build of the 2nd and so on...

    Finally, select the initial job (the unit test job in this case) in your pipeline view to get the pipeline display.