blob: ac27da898b4ff6d78c44da576b913df57cd3387a [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") {
Matthew Hartfb6fd362020-03-04 21:03:59 +000034 git url: '$CI_SCRIPTS_REPO', branch: '$CI_SCRIPTS_BRANCH', credentialsId: 'GIT_SSH_KEY'
Dean Birch62c4f082020-01-17 16:13:26 +000035 }
36 dir("mbed-crypto") {
37 checkout(
38 changelog: false,
39 poll: false,
40 scm: [
41 $class: 'GitSCM',
Matthew Hartfb6fd362020-03-04 21:03:59 +000042 branches: [[name: 'FETCH_HEAD']],
Dean Birch62c4f082020-01-17 16:13:26 +000043 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 Birch7249bfa2020-05-21 16:22:39 +010051 # Host https://github.com/Arm-software/CMSIS_5/releases/download/5.5.0/ARM.CMSIS.5.5.0.pack
52 # under \$JENKINS_HOME/userContent
53 set +e
54 wget -O cmsis.pack -q \${JENKINS_URL}/userContent/ARM.CMSIS.${CMSIS_VERSION}.pack
55 if [ "\$?" != "0" ] ; then
56 set -e
57 wget -O cmsis.pack -q https://github.com/Arm-software/CMSIS_5/releases/download/${CMSIS_VERSION}/ARM.CMSIS.${CMSIS_VERSION}.pack
58 fi
59 set -e
60 unzip -o -d CMSIS_5 cmsis.pack
61 """
Dean Birchd0f9f8c2020-03-26 11:10:33 +000062 if (env.PSA_API_SUITE != "") {
63 dir("psa-arch-tests") {
64 checkout(
65 changelog: false,
66 poll: false,
67 scm: [
68 $class: 'GitSCM',
69 branches: [[name: 'FETCH_HEAD']],
70 userRemoteConfigs: [[
71 refspec: 'refs/tags/v20.03_API1.0',
Matthew Hartfb6fd362020-03-04 21:03:59 +000072 url: params.PSA_ARCH_TESTS_URL
Dean Birchd0f9f8c2020-03-26 11:10:33 +000073 ]]
74 ]
75 )
76 }
77 }
Dean Birch62c4f082020-01-17 16:13:26 +000078 }
Dean Birchd0f9f8c2020-03-26 11:10:33 +000079 try {
80 verify = 1
81 stage("Build") {
82 tee("build.log") {
83 sh "tf-m-ci-scripts/run-build.sh"
84 }
85 }
86 stage("Post") {
87 archiveArtifacts 'trusted-firmware-m/build/install/**,build.log'
88 }
89 } catch (Exception e) {
90 manager.buildFailure()
91 verify = -1
92 } finally {
93 g = new Gerrit()
94 g.verifyStatusInWorkspace(verify, env.CONFIG_NAME, 'build')
Matthew Hartfb6fd362020-03-04 21:03:59 +000095 def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
96 //g.commentInWorkspace("Build configuration ${env.CONFIG_NAME} ${buildStatus}: ${env.RUN_DISPLAY_URL}")
Dean Birch62c4f082020-01-17 16:13:26 +000097 cleanWs()
98 }
99}