# Pastebin C16xZzCu @SuppressWarnings("GroovyAssignabilityCheck") def call(body) { def config = [:] body.resolveStrategy = Closure.DELEGATE_FIRST body.delegate = config body() def creds = config.creds ? config.creds : [:] pipeline { stages { stage('Doing stuff') { steps { script { deployCreds.each { key, value -> println "DEV KEY: " + value['dev'] + "PROD KEY: " + value['prod'] } } } } } } }