vars: Add "tfgit" procedural module to abstract Git operations
Immediate usecase: we clone tf-m-ci-scripts repo in many places, with
fairly complex parameters, so there's a lot of duplication, and updating
all occurrences is time consuming and error prone. So, let's factor out
that operation into a single function.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I7efb2e5bc7ec8c690eca5a114d6e48cb68ec3559
diff --git a/vars/tfgit.groovy b/vars/tfgit.groovy
new file mode 100644
index 0000000..8731fca
--- /dev/null
+++ b/vars/tfgit.groovy
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+def checkout_ci_scripts() {
+ checkout([
+ $class: 'GitSCM',
+ branches: [[name: '$CI_SCRIPTS_BRANCH']],
+ userRemoteConfigs: [[
+ credentialsId: 'GIT_SSH_KEY',
+ url: '$CI_SCRIPTS_REPO',
+ refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/remotes/origin/refs/changes/*'
+ ]]
+ ])
+}