From Fedora Project Wiki
Description
Command-line interface
Setup
- Ensure that jenkins-cli package is installed
How to test
- run "jenkins-cli -s http://localhost:8080/ help"
- you should see list of all available commands
- run "jenkins-cli -s http://localhost:8080/ list-jobs"
- you should see list of all configured projects:
project1
- run "jenkins-cli -s http://localhost:8080/ build project1 -s -v"
- this should start build of "project1" and you should see console output from the build:
Started project1 #2 Started by command line by anonymous Building in workspace /var/lib/jenkins/jobs/project1/workspace [workspace] $ /bin/sh -xe /tmp/hudson7729477737891392405.sh + echo 'Build Successful!' Build Successful! Finished: SUCCESS Completed project1 #2 : SUCCESS
- run "jenkins-cli -s http://localhost:8080/ groovysh"
- you should see Groovy shell prompt:
Groovy Shell (1.8.9, JVM: 1.8.0_11) Type 'help' or '\h' for help. ------------------------------------------------------------------------------- groovy:000>
- try to run some Groovy code, for example '"uname -a".execute().text'
- type "quit" to quit the Groovy shell
Expected Results
- there should be no failures or stacktraces printed on stdout/stderr