Show Menu

Jenkins CLI Cheat Sheet by

My most common Jenkins CLI commands
shell     cli     jenkins

Executing and Monitoring a Build Job

ssh -l kohsuke -p <RandomPort> <InternalJenkinsBuildUserName>@<JenkinsHostName> list-jobs
Build Project X
Build Project Y
ssh -l kohsuke -p <RandomPort> bob@JenkinsHost build 'Build\ Project\ x' -v
ssh -l kohsuke -p <RandomPort> bob@JenkinsHost console 'Build\ Project\ x' -f -n500

Stopping a Current Build Job

curl http://<jenkinshost:port>/job/Build%20-Project%20X/lastBuild/stop


1] Go to http:­//j­enk­ins­hos­t:8­080­/us­er/­<Je­nki­nsB­uil­dUs­er>­/co­nfi­gure
2] Get public key - cat ~/.ssh­/id­_rs­
3] Copy and paste public key into your jenkin's user 'SSH Public Keys' text box
4] Save

1] Go to http:­//g­ree­nla­nte­rn.l­oc­al:­808­0/c­onf­igu­reS­ecu­rity/
2] Select 'SSHD Port' to random
3] Discover the random ssh jenkins port via curl -Lv https:­//j­enk­ins­hos­t/login 2>&1 | grep 'X-SSH­-En­dpo­int'
3] Execute public key authen­icated jenkins commands via ssh -l kohsuke -p <Ra­ndo­mSS­HPo­rt> <Je­nki­nsB­uil­dUs­er>­@<J­enk­ins­Hos­t> list-jobs

Download the Jenkins CLI Cheat Sheet

1 Page

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!



No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          Android Package Manager (pm) Cheat Sheet
          Top 30 linux shell tricks Cheat Sheet

          More Cheat Sheets by edendekker

          Apache Cassandra CQL Cheat Sheet