What I have is a following:
vars folder called deleteFile.gr
For this use case, it will make more sense to use the library step to dynamically load it at runtime.
In your firstPipe.groovy you could do something like:
final myOneLib = library('myOneLib')
def execute(String zCmakeListsPath){
stage('some kind of stage 2') {
echo "Hello from stage 1 with " + zCmakeListsPath
echo "var attempt ${env.mySrcDir}"
}
stage('second stage'){
echo "and one from stage 2"
echo "param was " + zCmakeListsPath
echo "var attempt ${env.myBuildDir}"
//call function from global lib
myOneLib.deleteFile 'for 3rd party global library now'
}
}
return this
See the Loading libraries dynamically section of the Extending with Shared Libraries documentation.