blob: 363a256a6309e920d0b47aba92ccfe2e4ef1974a [file] [log] [blame]
def call(body) {
// evaluate the body block, and collect configuration into the object
def config = [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = config
body()
stage("Gerrit Patchset Checkout") {
checkout(
scm: [
$class: 'GitSCM',
branches: [[name: "${GERRIT_BRANCH}"]],
extensions: [
[$class: 'CleanCheckout'],
[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]
],
userRemoteConfigs: [[
credentialsId: "${config.credentialsId}",
name: 'gerrit',
url: "ssh://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}.git",
refspec: "${GERRIT_REFSPEC}"
]]
]
)
}
}