Last active
November 5, 2015 21:03
-
-
Save snallami/1186aa7df1111140c95a to your computer and use it in GitHub Desktop.
Jenkins useful tips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Groovy script to change build display value | |
// get current build | |
def build = Thread.currentThread().executable | |
// get new value for build | |
def newBuildName = build.getEnvironment().get('newDisplayVersionj') | |
// set new display name | |
try { | |
if (newBuildName) { | |
build.displayName = newBuildName | |
println "Build display name is set to ${newBuildName}" | |
} | |
} catch (MissingPropertyException e) {} | |
2) To find out which jobs are using which plugins | |
Find out the string which we can grep for in config.xml. Mostly it can be xml node name or attribute | |
e.g. In case of Job DSL plugin i can grep for pattern# plugin=\"job-dsl* | |
grep --include=config.xml -rnw '#JENKINSHOME/jobs/' -e "plugin=\"job-dsl*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment