Created
December 22, 2018 12:16
-
-
Save ansig/3fe186dbfc51ca3773db1a16ba7338f6 to your computer and use it in GitHub Desktop.
Jenkins Groovy script that executes all scripts in init.groovy.d
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
import groovy.io.FileType | |
def initGroovyDir = new File("${System.getenv('JENKINS_HOME')}/init.groovy.d") | |
initGroovyDir.eachFileMatch(FileType.FILES, ~/.*\.groovy/) { | |
println "Running: ${it}" | |
new GroovyShell(this.class.classLoader).evaluate(it) | |
} | |
println "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment