Extend gerritPatchsetCheckout to support timeout and depth
Change-Id: I66039cbd73c12138b133b22ba795544ee5b8c39b
diff --git a/src/com/mirantis/mk/Gerrit.groovy b/src/com/mirantis/mk/Gerrit.groovy
index e7340a3..932cb06 100644
--- a/src/com/mirantis/mk/Gerrit.groovy
+++ b/src/com/mirantis/mk/Gerrit.groovy
@@ -38,11 +38,15 @@
def gerritProject = config.get('gerritProject', GERRIT_PROJECT)
def gerritBranch = config.get('gerritBranch', GERRIT_BRANCH)
def path = config.get('path', "")
+ def depth = config.get('depth', 0)
+ def timeout = config.get('timeout', 20)
// default parameters
def scmExtensions = [
[$class: 'CleanCheckout'],
- [$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]
+ [$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']],
+ [$class: 'CheckoutOption', timeout: timeout],
+ [$class: 'CloneOption', depth: depth, noTags: false, reference: '', shallow: depth > 0, timeout: timeout]
]
def scmUserRemoteConfigs = [
name: 'gerrit',