Add git clone over ssh protocol
We need to have some short-hand for clonning over ssh:// protocol
this patch implements such functionality.
Usage example:
node {
gitSSHCheckout {
credentialsId = "mcp-ci-gerrit"
branch = "mcp-0.1"
host = "ci.mcp-ci.local"
project = "projectcalico/calico-containers"
}
}
Change-Id: I5f8390cdbbd3df06cffa703190534fe10ecfd1ca
diff --git a/vars/gitSSHCheckout.txt b/vars/gitSSHCheckout.txt
new file mode 100644
index 0000000..087d018
--- /dev/null
+++ b/vars/gitSSHCheckout.txt
@@ -0,0 +1,27 @@
+// Default parameters
+
+ target_dir = "./"
+ port = "29418"
+
+// Usage example
+node {
+ gitSSHCheckout {
+ credentialsId = "mcp-ci-gerrit"
+ branch = "mcp-0.1"
+ host = "ci.mcp-ci.local"
+ project = "projectcalico/calico-containers"
+ }
+}
+
+// or
+
+node {
+ gitSSHCheckout {
+ credentialsId = "mcp-ci-gerrit"
+ branch = "mcp-0.1"
+ host = "ci.mcp-ci.local"
+ project = "projectcalico/calico-containers"
+ target_dir = "some_directory"
+ }
+}
+