blob: 7096c612ddba8122cdaeae3e8c0f9e5f5c88d48f [file] [log] [blame]
Sergey Kulanov72f763e2016-09-29 17:08:44 +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 def target_dir = config.target_dir ?: "./"
9 def port = config.port ?: "29418"
10
11 stage("Git Checkout"){
12 checkout(
13 scm: [
14 $class: 'GitSCM',
15 branches: [[name: "${config.branch}"]],
16 extensions: [
17 [$class: 'CleanCheckout'],
18 [$class: 'RelativeTargetDirectory', relativeTargetDir: "${target_dir}"]
19 ],
20 userRemoteConfigs: [[
21 credentialsId: "${config.credentialsId}",
22 name: 'origin',
23 url: "ssh://${config.credentialsId}@${config.host}:${port}/${config.project}.git"
24 ]]
25 ]
26 )
27 }
28}