Skip to content

Instantly share code, notes, and snippets.

@TBeijen
Created May 30, 2018 05:49
Show Gist options
  • Save TBeijen/b8adbc883c127d83dd22f9571569528d to your computer and use it in GitHub Desktop.
Save TBeijen/b8adbc883c127d83dd22f9571569528d to your computer and use it in GitHub Desktop.
Jenkinsfile & shared pipeline constructs
// /src/org/foo/utils.groovy
package org.foo
class Utils {
static def doStuff() {
return "done"
}
}
// /vars/example.groovy
import static org.foo.Utils.doStuff
def call() {
doStuff()
}
// -----------------------
// Importing classes from shared library
// Note: This causes linter to fail, see: https://issues.jenkins-ci.org/browse/JENKINS-42730
// Jenkinsfile
@Library('pipeline-shared') import org.foo.Utils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment