【Jenkins】一种闭包(函数嵌套)函数的Jenkinsfile写法,类似于Python的装饰器
defprepare(MapJOB,Closurebody){dir('xxxxx'){sh(script:"gitupdate${JOB.version}")body()}}//调用方法1prepare(version:"3asd8asd7a7ds"){sh(script:"gitcommit")}defJOB=[version:"3asd8asd7a7ds",xxxx:"xxxx"]//调用方