blob: fbb86116a486f916cf9a43efd7c84d1fc531b578 [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") {
13 git url: '$CI_SCRIPTS_REPO', branch: 'master', credentialsId: 'GIT_SSH_KEY'
14 }
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 = ""
20 if (env.BL2.equals("True")) {
21 bl2_string = "--bl2"
22 }
23 dir("tf-m-ci-scripts") {
24 def res = sh(script: """./lava_helper/lava_create_jobs.py \
25--build-number ${env.BUILD_NUMBER} --output-dir lava_jobs \
26--compiler ${env.COMPILER} --platform ${env.TARGET_PLATFORM} \
27${bl2_string} --build-type ${env.CMAKE_BUILD_TYPE} \
28--jenkins-build-url ${env.BUILD_URL} --proj-config ${env.PROJ_CONFIG}
29""", returnStdout: true).trim()
30 print(res)
31 job_ids = sh(script: """./lava_helper/lava_submit_jobs.py \
32 --lava-url https://tf.validation.linaro.org --job-dir lava_jobs \
33 --lava-user ${LAVA_USER} --lava-token ${LAVA_TOKEN}
34 """, returnStdout: true).trim()
35 currentBuild.setDescription(job_ids)
36 }
37 }
38 }
39 stage("Post") {
40 archiveArtifacts artifacts: 'tf-m-ci-scripts/lava_jobs/**', allowEmptyArchive: true
41 cleanWs()
42 }
43}