blob: 363a256a6309e920d0b47aba92ccfe2e4ef1974a [file] [log] [blame]
Igor Belikov9021bbe2016-09-28 19:22:20 +03001def call(body) {
2 // evaluate the body block, and collect configuration into the object
3 def config = [:]
4 body.resolveStrategy = Closure.DELEGATE_FIRST
5 body.delegate = config
6 body()
7
8 stage("Gerrit Patchset Checkout") {
9 checkout(
10 scm: [
11 $class: 'GitSCM',
12 branches: [[name: "${GERRIT_BRANCH}"]],
13 extensions: [
14 [$class: 'CleanCheckout'],
15 [$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]
16 ],
17 userRemoteConfigs: [[
18 credentialsId: "${config.credentialsId}",
19 name: 'gerrit',
20 url: "ssh://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}.git",
21 refspec: "${GERRIT_REFSPEC}"
22 ]]
23 ]
24 )
25 }
26}