Jenkins: Introduce a global share repository mechanism
This is a full refactor of the way jobs fetch git data: with this
approach, only the top level job, the upstream job, would set a share
folder populated with all required repositories, including
trusted-firmware-m, tf-m-tests, tf-m-ci-scripts, mbed-tls, mcuboot and
psa-arch-tests, ultimately consumed by downtream jobs,
i.e. tf-m-build-config.
This would reduce considerably the CI build times, avoiding multiple
clones per job thus overloading the TF git servers.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Change-Id: Iec3f0cc345c5052d64f0ea6ca9da01e9149a7b8b
diff --git a/jenkins/checkpatch.jpl b/jenkins/checkpatch.jpl
index 5e8637d..2f87a98 100644
--- a/jenkins/checkpatch.jpl
+++ b/jenkins/checkpatch.jpl
@@ -11,23 +11,12 @@
timestamps {
node("docker-amd64-tf-m-bionic") {
+ // Clone TF-M repositories so share folder can be reused by downstream jobs
stage("Init") {
cleanWs()
- dir("trusted-firmware-m") {
- checkout(
- poll: false,
- scm: [
- $class: 'GitSCM',
- branches: [[name: '$GERRIT_BRANCH']],
- extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
- userRemoteConfigs: [[
- credentialsId: 'GIT_SSH_KEY',
- refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO'
- ]]
- ])
- }
dir("tf-m-ci-scripts") {
checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]])
+ sh "./clone.sh"
}
}
stage("Check") {