Last active
October 12, 2016 07:41
-
-
Save BenjaminHerbert/71aca1fe3a1fcdb6de7bc390453b317c to your computer and use it in GitHub Desktop.
Job DSL reuse - See: http://herbert.cc/blog/jenkins-job-dsl-refactoring/
This file contains hidden or 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
job('test') { | |
steps{ | |
maven { | |
mavenInstallation('3.3.9') | |
goals('fuu:bar') | |
} | |
maven { | |
mavenInstallation('3.3.9') | |
goals('compile') | |
} | |
} | |
} |
This file contains hidden or 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
job('test') { | |
steps{ | |
addMavenGoal delegate, 'maven-3.3.9', 'fuu:bar' | |
addMavenGoal delegate, 'maven-3.3.9', 'compile' | |
} | |
} | |
def addMavenGoal(context, mavenVersion, goal) { | |
context.with { | |
maven { | |
mavenInstallation(mavenVersion) | |
goals(goal) | |
} | |
} | |
} |
This file contains hidden or 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
def maven = 'maven-3.3.9' | |
job('test') { | |
steps{ | |
addMavenGoal delegate, maven, 'fuu:bar' | |
addMavenGoal delegate, maven, 'compile' | |
} | |
} | |
def addMavenGoal(context, mavenVersion, goal) { | |
context.with { | |
maven { | |
mavenInstallation(mavenVersion) | |
goals(goal) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment