blob: 4be24b54dd173ce9495511d3660e1b897f4e9806 [file] [log] [blame]
Dean Bircha6ede7e2020-03-13 14:00:33 +00001#!/usr/bin/env groovy
2//-------------------------------------------------------------------------------
3// Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
4//
5// SPDX-License-Identifier: BSD-3-Clause
6//
7//-------------------------------------------------------------------------------
8
9node("docker-amd64-xenial") {
10 stage("Init") {
11 cleanWs()
12 dir("tf-m-ci-scripts") {
Matthew Hartfb6fd362020-03-04 21:03:59 +000013 git url: '$CI_SCRIPTS_REPO', branch: '$CI_SCRIPTS_BRANCH', credentialsId: 'GIT_SSH_KEY'
Dean Bircha6ede7e2020-03-13 14:00:33 +000014 }
15 }
16 stage("LAVA") {
17 withCredentials([usernamePassword(credentialsId: 'LAVA_CREDENTIALS', passwordVariable: 'LAVA_TOKEN', usernameVariable: 'LAVA_USER')]) {
18 print("Generating LAVA jobs...")
19 def bl2_string = ""
Matthew Hart2c2688f2020-05-26 13:09:20 +010020 def psa_string = ""
Dean Bircha6ede7e2020-03-13 14:00:33 +000021 if (env.BL2.equals("True")) {
22 bl2_string = "--bl2"
23 }
Matthew Hart2c2688f2020-05-26 13:09:20 +010024 // work around this string containing quotes?
25 if (!env.PSA_API_SUITE.replace('\'', '').isEmpty()) {
26 psa_string = "--psa-api-suite ${env.PSA_API_SUITE}"
27 }
Dean Bircha6ede7e2020-03-13 14:00:33 +000028 dir("tf-m-ci-scripts") {
29 def res = sh(script: """./lava_helper/lava_create_jobs.py \
30--build-number ${env.BUILD_NUMBER} --output-dir lava_jobs \
31--compiler ${env.COMPILER} --platform ${env.TARGET_PLATFORM} \
Matthew Hart2c2688f2020-05-26 13:09:20 +010032${bl2_string} ${psa_string} --build-type ${env.CMAKE_BUILD_TYPE} \
Matthew Hartfb6fd362020-03-04 21:03:59 +000033--jenkins-build-url ${env.BUILD_URL} --proj-config ${env.PROJ_CONFIG} \
34--docker-prefix ${env.DOCKER_PREFIX} --license-variable "${env.LICENSE_VARIABLE}"
Dean Bircha6ede7e2020-03-13 14:00:33 +000035""", returnStdout: true).trim()
36 print(res)
37 job_ids = sh(script: """./lava_helper/lava_submit_jobs.py \
Matthew Hartfb6fd362020-03-04 21:03:59 +000038 --lava-url ${env.LAVA_URL} --job-dir lava_jobs \
39 --lava-user ${LAVA_USER} --lava-token ${LAVA_TOKEN} | egrep "^JOBS"
Dean Bircha6ede7e2020-03-13 14:00:33 +000040 """, returnStdout: true).trim()
41 currentBuild.setDescription(job_ids)
42 }
43 }
44 }
45 stage("Post") {
46 archiveArtifacts artifacts: 'tf-m-ci-scripts/lava_jobs/**', allowEmptyArchive: true
47 cleanWs()
48 }
49}