0

There is a system that periodically runs on Jenkins and that I follow with selenium. (I'm checking its performance on "manager/status" page in Tomcat). I want it to trigger the second job, which will make detailed logging (*1) only when there is an error in the job. How can I do it?

When the first job is successful I can trigger the 2nd job but what I need is to trigger the 2nd job when the first job failsenter image description here

(*1) I'm checking the geoserver performance. "http://serverip:port/geoserver/rest/monitor/requests.csv?order=totalTime;ASC" will download the performance values on geoserver server in "xls" format on jenkins server.

2 Answers 2

0

I see your using a freestyle job, but this is where Jenkins pipelines shine.

node() {
    
    try {
        // do your testing
    } catch (Exception e) {
        build(job: 'detailed_logging')
    }
}

You can find more detail in the build step documentation.

0

Use the Parameterized Trigger (https://plugins.jenkins.io/parameterized-trigger/) in your Post Build Actions. In my example I did not pass any parameters to the new job.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.