-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
CLI
Add keys for authenticated login. Works fine with who-am-i, enable-job, disable-job, delete-job, create-job, but get-job and update-job fail claiming there is no job by that name. The very same command line with enable-job (as well as the others) works fine.
Workaround is to see if enable-job fails (which it will if there is no job by that name, which was the point of using get-job), then delete-job and create-job instead of update-job if the job already exists. Note that this workaround causes the loss of job history upon deletion.
Diagnostics:
% java -jar jenkins/_jenkins-cli.jar -s http://localhost:9090/ -i jenkins/id_rsa get-job trunk-pacman.integration.vdev-regression
No such job 'trunk-pacman.integration.vdev-regression'
java -jar jenkins-cli.jar get-job args...
Dumps the job definition XML to stdout
JOB : Name of the job
--username VAL : User name to authenticate yourself to Jenkins
--password VAL : Password for authentication. Note that passing a
password in arguments is insecure.
--password-file VAL : File that contains the password
% java -jar jenkins/_jenkins-cli.jar -s http://localhost:9090/ -i jenkins/id_rsa enable-job trunk-pacman.integration.vdev-regression
% echo $?
0
[JENKINS-11024] Some commands don't work when using _jenkins-cli.jar with -i switch, get-job and update-job for sure, not certain about others
Description |
Original:
Add keys for authenticated login. Works fine with who-am-i, enable-job, disable-job, delete-job, create-job, but get-job and update-job fail claiming there is no job by that name. The very same command line with enable-job (as well as the others) works fine. Workaround is to see if enable-job fails (which it will if there is no job by that name, which was the point of using get-job), then delete-job and create-job instead of update-job if the job already exists. Diagnostics: % java -jar jenkins/_jenkins-cli.jar -s http://localhost:9090/ -i jenkins/id_rsa get-job trunk-pacman.integration.vdev-regression No such job 'trunk-pacman.integration.vdev-regression' java -jar jenkins-cli.jar get-job args... Dumps the job definition XML to stdout JOB : Name of the job --username VAL : User name to authenticate yourself to Jenkins --password VAL : Password for authentication. Note that passing a password in arguments is insecure. --password-file VAL : File that contains the password % java -jar jenkins/_jenkins-cli.jar -s http://localhost:9090/ -i jenkins/id_rsa enable-job trunk-pacman.integration.vdev-regression % echo $? 0 |
New:
Add keys for authenticated login. Works fine with who-am-i, enable-job, disable-job, delete-job, create-job, but get-job and update-job fail claiming there is no job by that name. The very same command line with enable-job (as well as the others) works fine. Workaround is to see if enable-job fails (which it will if there is no job by that name, which was the point of using get-job), then delete-job and create-job instead of update-job if the job already exists. Note that this workaround causes the loss of job history upon deletion. Diagnostics: % java -jar jenkins/_jenkins-cli.jar -s http://localhost:9090/ -i jenkins/id_rsa get-job trunk-pacman.integration.vdev-regression No such job 'trunk-pacman.integration.vdev-regression' java -jar jenkins-cli.jar get-job args... Dumps the job definition XML to stdout JOB : Name of the job --username VAL : User name to authenticate yourself to Jenkins --password VAL : Password for authentication. Note that passing a password in arguments is insecure. --password-file VAL : File that contains the password % java -jar jenkins/_jenkins-cli.jar -s http://localhost:9090/ -i jenkins/id_rsa enable-job trunk-pacman.integration.vdev-regression % echo $? 0 |
Resolution | New: Cannot Reproduce [ 5 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Resolution | Original: Cannot Reproduce [ 5 ] | |
Status | Original: Resolved [ 5 ] | New: Reopened [ 4 ] |
Resolution | New: Cannot Reproduce [ 5 ] | |
Status | Original: Reopened [ 4 ] | New: Resolved [ 5 ] |
Workflow | Original: JNJira [ 141234 ] | New: JNJira + In-Review [ 189505 ] |