0 votes
in Jenkins by
How to download the Console log for a particular Jenkins build programmatically?

1 Answer

0 votes
by

Using the Jenkins CLI - console - command

java -jar jenkins-cli.jar console JOB [BUILD] [-f] [-n N]

Produces the console output of a specific build to stdout, as if you are doing 'cat build.log'

JOB: Name of the job

BUILD: Build number or permalink to point to the build. Defaults to the last build

-f: If the build is in progress, append console output as it comes, like tail -f

-n N: Display the last N lines.

E.g.

ssh -l <ssh_username> -p <port_no> <Jenkins_URL> console <JOB_NAME>

Related questions

0 votes
asked Dec 10, 2022 in Jenkins by SakshiSharma
0 votes
asked Dec 10, 2022 in Jenkins by SakshiSharma
...