Skip to content

Instantly share code, notes, and snippets.

@matthiasbaldi
Created February 15, 2017 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthiasbaldi/b226ff43596e2f02a416ce5656546eaa to your computer and use it in GitHub Desktop.
Save matthiasbaldi/b226ff43596e2f02a416ce5656546eaa to your computer and use it in GitHub Desktop.
load groovy file/lib into Jenkinsfile
node(label) {
step([$class: 'WsCleanup'])
sh "wget -O ./pipeline.lib.groovy https://github.com/<url>/pipeline.lib.groovy"
def pipelineLib = load 'pipeline.lib.groovy'
pipelineLib.checkoutSource(<your params>)
pipelineLib.buildProject(<your params>)
pipelineLib.publishArtifacts(<your params>)
pipelineLib.archiveArtifacts(<your params>)
}
public checkoutSource(<your params>) {
// do something
}
public buildProject(<your params>) {
// do something
}
public publishArtifacts(<your params>) {
// do something
}
public archiveArtifacts(<your params>) {
// do something
}
return this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment