Using CheatSheets To Apply Best Practices

Jenkins Cheatsheet

1.1 Jenkins Summary

Name Command
Test groovy code from Jenkins GUI Manage Jenkins -> Script Console
Jenkins Slave Node  

1.2 Jenkins Plugins

Name Command
Backup jenkins ThinBackup Plugin
Load the ssh key Credentials Plugin
Add timestamp to job output Timestamper Plugin
Create dashboard Dashboard View Plugin
Abort if job takes too long Build-timeout Plugin
Retry failed a job Naginator Plugin
Backup job configuration JobConfigHistory Plugin

1.3 Jenkins Pipeline

Name Command
Pass parameter across jenkins jobs See jenkinsfile-pass-parameter
Set timeout & retry See jenkinsfile-timeout-retry
Use finally to do cleanup See jenkinsfile-finally
Run jenkins jobs in a sequential way See jenkinsfile-sequentially
Run jenkins jobs in parallel See jenkinsfile-parallelly

1.4 Jenkins Groovy

Name Command
Print message to stdout See print.groovy
Get environment variables See get-env.groovy
Convert string to list See split-string.groovy
Create string with multi-lines See multi-line-string.groovy
Loop a map See loop-map.groovy
Get hostname by ip See get-ip-by-hostname.groovy
Convert list to string l.join(";"), link: groovy list

Leave a Reply

Your email address will not be published. Required fields are marked *