cliffano / nestor

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

Build does not work on Jenkins 1.5xx when job build trigger requires auth #12

Closed cliffano closed 11 years ago

cliffano commented 11 years ago

Reported by @cgiffard.

'nestor build' does not trigger the actual build on Jenkins 1.5xx .

I have verified this problem with latest Nestor master (0.1.2-pre) and Jenkins master (1.511 SNAPSHOT)

cgiffard commented 11 years ago

I can verify that doing a one-two punch of a POST and then a GET provides the correct response.

cliffano commented 11 years ago

Can you confirm that the build job you're testing require authentication?

cgiffard commented 11 years ago

Yeah, it does. I'll download your new build and double check.

cgiffard commented 11 years ago

New build does not trigger a new, er, build.

Also returns cached build console.

Nestor 0.1.2, Jenkins ver. 1.508.


nestor build --console TEST-dispatch2-update fails.

However, the following successfully runs the job and returns the console properly:

nestor build --console TEST-dispatch2-update param=nothing
nestor build --console TEST-dispatch2-update
cgiffard commented 11 years ago

No change in behaviour with the -p flag, unfortunately.

cliffano commented 11 years ago

Please try latest master: git clone http://github.com/cliffano/nestor && cd nestor && npm link

I've tested it with jobs that do and don't require auth and params.

The -p flag is used as a delay between triggering a build to start listening for console output. By default 'nestor build -c ' waits for 5 seconds before listening to console output, but some jobs might take more than 5 secs to start writing console output, so the -p flag is added to customise the wait time, e.g. 'nestor build -c -p 10000 ' if you want to wait for 10 secs.

Please let me know how you go with it. If it works, I'll publish a new version a.s.a.p .

cliffano commented 11 years ago

I've got confirmation from other users that the fix works for them, so I've gone ahead and published v0.1.3 . I've also tested it with Jenkins v1.4xx and it works fine.

jglick commented 11 years ago

Sorry for any inconvenience. Confirming that using POST unconditionally is the correct method (for this and any other REST URL that is intended to produce an action).

cliffano commented 11 years ago

Thanks for the confirmation @jglick . I'll close this issue as fixed in v0.1.3 .