blob: b4263cda4431ef3671581fd4b2d9059d06a9713a [file] [log] [blame]
Dean Birch62c4f082020-01-17 16:13:26 +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
Dean Birchd0f9f8c2020-03-26 11:10:33 +00009@Library('trustedfirmware') _
10import org.trustedfirmware.Gerrit
11
12def nodeLabel = "docker-amd64-xenial"
13if (env.COMPILER == "ARMCLANG") {
14 nodeLabel = "docker-amd64-xenial-armclang"
15}
16
17node(nodeLabel) {
Dean Birch62c4f082020-01-17 16:13:26 +000018 stage("Init") {
19 cleanWs()
20 dir("trusted-firmware-m") {
21 checkout(
22 poll: false,
23 scm: [
24 $class: 'GitSCM',
25 branches: [[name: '$GERRIT_BRANCH']],
26 extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
27 userRemoteConfigs: [[
28 credentialsId: 'GIT_SSH_KEY',
29 refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO'
30 ]]
31 ])
32 }
33 dir("tf-m-ci-scripts") {
34 git url: '$CI_SCRIPTS_REPO', branch: 'master', credentialsId: 'GIT_SSH_KEY'
35 }
36 dir("mbed-crypto") {
37 checkout(
38 changelog: false,
39 poll: false,
40 scm: [
41 $class: 'GitSCM',
42 branches: [[name: 'FETCH_HEAD']],
43 userRemoteConfigs: [[
44 refspec: 'refs/tags/$MBEDCRYPTO_VERSION',
Dean Bircha6ede7e2020-03-13 14:00:33 +000045 url: params.MBEDCRYPTO_URL
Dean Birch62c4f082020-01-17 16:13:26 +000046 ]]
47 ]
48 )
49 }
50 sh """
Dean Bircha6ede7e2020-03-13 14:00:33 +000051# Host https://github.com/Arm-software/CMSIS_5/releases/download/5.5.0/ARM.CMSIS.5.5.0.pack
52# under \$JENKINS_HOME/userContent
53wget -O cmsis.pack -q \${JENKINS_URL}/userContent/ARM.CMSIS.${CMSIS_VERSION}.pack
Dean Birch62c4f082020-01-17 16:13:26 +000054unzip -o -d CMSIS_5 cmsis.pack
55"""
Dean Birchd0f9f8c2020-03-26 11:10:33 +000056 if (env.PSA_API_SUITE != "") {
57 dir("psa-arch-tests") {
58 checkout(
59 changelog: false,
60 poll: false,
61 scm: [
62 $class: 'GitSCM',
63 branches: [[name: 'FETCH_HEAD']],
64 userRemoteConfigs: [[
65 refspec: 'refs/tags/v20.03_API1.0',
66 url: 'https://github.com/ARM-software/psa-arch-tests'
67 ]]
68 ]
69 )
70 }
71 }
Dean Birch62c4f082020-01-17 16:13:26 +000072 }
Dean Birchd0f9f8c2020-03-26 11:10:33 +000073 try {
74 verify = 1
75 stage("Build") {
76 tee("build.log") {
77 sh "tf-m-ci-scripts/run-build.sh"
78 }
79 }
80 stage("Post") {
81 archiveArtifacts 'trusted-firmware-m/build/install/**,build.log'
82 }
83 } catch (Exception e) {
84 manager.buildFailure()
85 verify = -1
86 } finally {
87 g = new Gerrit()
88 g.verifyStatusInWorkspace(verify, env.CONFIG_NAME, 'build')
Dean Birch62c4f082020-01-17 16:13:26 +000089 cleanWs()
90 }
91}