Initial structure and basic funtions

* Create initial repository structure
* Add gerritPatchsetCheckout and runTox global functions

Change-Id: I3c716e12dec76bb405d33501bc260425419814be
diff --git a/vars/gerritPatchsetCheckout.groovy b/vars/gerritPatchsetCheckout.groovy
new file mode 100644
index 0000000..363a256
--- /dev/null
+++ b/vars/gerritPatchsetCheckout.groovy
@@ -0,0 +1,26 @@
+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}"
+        ]]
+      ]
+    )
+  }
+}