Update pipeline to pass variable to downstream job
Update piplines to allow CI_SCRIPTS_BRANCH variable to be used in
downstream jobs.
Fix: Update build pipelines to checkout code rather than using the git
plugin. This is due to a bug in the Jenkins git plugin that does not
fetch tags.
Signed-off-by: Colin Thorbinson <colin.thorbinson@arm.com>
Change-Id: I902496b0a96129fa25557e2051330cda8f4a0fd1
diff --git a/jenkins/ci.jpl b/jenkins/ci.jpl
index 167c1d4..099ff2e 100644
--- a/jenkins/ci.jpl
+++ b/jenkins/ci.jpl
@@ -285,6 +285,7 @@
params += string(name: 'MBEDTLS_VERSION', value: env.MBEDTLS_VERSION)
params += string(name: 'CODE_REPO', value: env.CODE_REPO)
params += string(name: 'CODE_COVERAGE_EN', value: env.CODE_COVERAGE_EN)
+ params += string(name: 'CI_SCRIPTS_BRANCH', value: env.CI_SCRIPTS_BRANCH)
return { -> results
def build_res = build(job: 'tf-m-build-config', parameters: params, propagate: false)
def build_info = [build_res, config, params_collection]
@@ -328,6 +329,7 @@
params += string(name: 'GERRIT_REFSPEC', value: env.GERRIT_REFSPEC)
params += string(name: 'MBEDTLS_VERSION', value: env.MBEDTLS_VERSION)
params += string(name: 'CODE_REPO', value: env.CODE_REPO)
+ params += string(name: 'CI_SCRIPTS_BRANCH', value: env.CI_SCRIPTS_BRANCH)
return { -> results
def res = build(job: 'tf-m-build-docs', parameters: params, propagate:false)
print("${res.number}: Docs ${res.result} ${res.getAbsoluteUrl()}")
@@ -545,7 +547,7 @@
stage("Init") {
cleanWs()
dir("tf-m-ci-scripts") {
- git url: '$CI_SCRIPTS_REPO', branch: '$CI_SCRIPTS_BRANCH', credentialsId: 'GIT_SSH_KEY'
+ checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]])
}
}
stage("Configs") {
@@ -596,7 +598,7 @@
}
stage("Tests") {
dir("tf-m-ci-scripts") {
- git url: '$CI_SCRIPTS_REPO', branch: '$CI_SCRIPTS_BRANCH', credentialsId: 'GIT_SSH_KEY'
+ checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]])
}
def all_jobs = []
def success = true