#!/usr/bin/env groovy void call(Map config = [:], Closure body) { Map defaults = [ stepName: 'Checkout', useJobSCM: true ] echo 'Firing ...' runConfig = defaults + config stage(runConfig.stepName) { repetitions = runConfig.stepName.length() + 2 boxTop = '+' + '=' * repetitions + '+' echo "${boxTop}\n| ${runConfig.stepName} |\n${boxTop}\n" printBanner(runConfig.stepName) if (runConfig.useJobSCM) { checkout scm } body() } }