Cheatography
https://cheatography.com
My most common Jenkins CLI commands
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
|
Setup
1] Go to http://jenkinshost:8080/user/<JenkinsBuildUser>/configure
2] Get public key - cat ~/.ssh/id_rsa.pub
3] Copy and paste public key into your jenkin's user 'SSH Public Keys' text box
4] Save
1] Go to http://greenlantern.local:8080/configureSecurity/
2] Select 'SSHD Port' to random
3] Discover the random ssh jenkins port via curl -Lv https://jenkinshost/login 2>&1 | grep 'X-SSH-Endpoint'
3] Execute public key authenicated jenkins commands via ssh -l kohsuke -p <RandomSSHPort> <JenkinsBuildUser>@<JenkinsHost> list-jobs
|
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by edendekker