How to get Jenkins “Console Output” after triggering build remotely?

后端 未结 3 1015
北荒
北荒 2020-12-24 12:44

I am using a Perl script to trigger a build in Jenkins using LWP modules. This works but after executing the job, I would like to parse the console output.

Is there

相关标签:
3条回答
  • 2020-12-24 13:08

    Log into Jenkins and take a look at the bottom of the webpage near the right hand side and click on the REST API link. This will give you information about the Jenkins RESTful API which is a great way to pull information off of Jenkins once you understand how to construct the URL.

    And, here's how you get the console text:

    $ curl "${JENKINS_URL}/job/${JOB_NAME}/lastBuild/consoleText"
    

    You can use Perl's various LWP modules to talk to Jenkins.

    0 讨论(0)
  • 2020-12-24 13:14

    Use the Log Parser Plugin for Jenkins. Read the page number 24 here for the configuration and other details.

    0 讨论(0)
  • 2020-12-24 13:14

    If you want to access the log from another Jenkins job that runs on the master, you can do it from a chained (child) job without needing to send an http GET. See https://stackoverflow.com/a/41974193/1580627.

    0 讨论(0)
提交回复
热议问题