Using Shared Library

Using Shared Library

@Library("kcdc@master") _

@Library("github.com/nrayapati/kcdc_2019_workshop@master") _

node {
    
    def yaml = libraryResource 'org/kcdc/test.yml'
    println yaml

    writeFile file: 'test.groovy', text: '''// Methods in this file will end up as object methods on the object that load returns.
    def lookAtThis(String whoAreYou) {
        echo "Look at this, ${whoAreYou}! You loaded this from another file!"
    }
    
    return this;'''

    def loadMethod = load 'test.groovy'
    loadMethod.lookAtThis("Naresh")
    
}