cliffano / nestor

Jenkins CLI and node.js client
http://blog.cliffano.com/tag/nestor/
MIT License
182 stars 27 forks source link

--console flag show console output from previous build #38

Closed joelittlejohn closed 8 years ago

joelittlejohn commented 8 years ago

When I trigger a build like this:

$ nestor build --console my-job

I expect that the console output of the new build will be streamed to my terminal, however nestor prints the console output from the previous build and exits.

Jenkins version is 2.10

cliffano commented 8 years ago

@joelittlejohn That can happen when the bulid doesn't start immediately (e.g. due to executor starvation or slow host).

Try waiting for 5 secs after the build before streaming the console output: nestor build --pending 5000 --console my-job

Or run console command after Jenkins starts building the job: nestor console my-job

Please let me know if either of these work for you.

joelittlejohn commented 8 years ago

Hi @cliffano. Both of these solutions do work, thanks.

Via the Jenkins API it's possible to track the build you have invoked to find out if it has started yet (looks for the 'executable' property). When nestor is invoked with --console we should poll the job until the build starts and stream the correct console output I think.

cliffano commented 8 years ago

@joelittlejohn Thanks for confirmation. I'm going to close this issue off.

I see that you forked the repo, so I'm looking forward to the contribution for the support to wait for the build to start before streaming the console output.

Thanks for pointing out the 'executable' property, I must've missed that when I first implemented the feature.

joelittlejohn commented 8 years ago

Fixed by #39