I'm trying to run commands on jenkins in a Ubuntu machine, but when I try do any thing through terminal, like a simple restart just for a test,is displayed that error:
Unable to access jarfile jenkins-cli.jar
So, my jenkins-cli.jar may be in the wrong place. Any help is welcome.
Thanks.
Remember yo have to download the jenkins-cli.jar file (I think even if you are working where jenkins is hosted). Go to http://jenkins_url/cli
(in my case is http://host_machine:8080/jenkins/cli
). There you have the link to download the file. Save it where you want.
Then try tu run an instruction. For example, for building a project run
java -jar /path_to_cli-file/jenkins-cli.jar -s http://jenkins_url build job_name
Remember that the user you are working with should have the right permissions to execute the action.
I've just tested that, so I hope it works.
If you still have problems don't hesistate to ask.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With