Add path in gerrit.groovy

Change-Id: I87e832b795fbb9d6eca6c237572e85369a96da12
diff --git a/src/com/mirantis/mk/Gerrit.groovy b/src/com/mirantis/mk/Gerrit.groovy
index dc3de1b..e7340a3 100644
--- a/src/com/mirantis/mk/Gerrit.groovy
+++ b/src/com/mirantis/mk/Gerrit.groovy
@@ -37,6 +37,7 @@
     def gerritPort = config.get('gerritPort', GERRIT_PORT)
     def gerritProject = config.get('gerritProject', GERRIT_PROJECT)
     def gerritBranch = config.get('gerritBranch', GERRIT_BRANCH)
+    def path = config.get('path', "")
 
     // default parameters
     def scmExtensions = [
@@ -66,12 +67,25 @@
         scmExtensions.add([$class: 'WipeWorkspace'])
     }
 
-    checkout(
-        scm: [
-            $class: 'GitSCM',
-            branches: [[name: "${gerritBranch}"]],
-            extensions: scmExtensions,
-            userRemoteConfigs: [scmUserRemoteConfigs]
-        ]
-    )
+    if (path == "") {
+        checkout(
+            scm: [
+                $class: 'GitSCM',
+                branches: [[name: "${gerritBranch}"]],
+                extensions: scmExtensions,
+                userRemoteConfigs: [scmUserRemoteConfigs]
+            ]
+        )
+    } else {
+        dir(path) {
+            checkout(
+                scm: [
+                    $class: 'GitSCM',
+                    branches: [[name: "${gerritBranch}"]],
+                    extensions: scmExtensions,
+                    userRemoteConfigs: [scmUserRemoteConfigs]
+                ]
+            )
+        }
+    }
 }
\ No newline at end of file