blob: ecfa1a77e7dd75eab6f865c4db545db4b5f286f5 [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 }
Tamas Ban260faf42020-06-08 16:14:55 +010050 dir("mcuboot") {
51 checkout(
52 changelog: false,
53 poll: false,
54 scm: [
55 $class: 'GitSCM',
56 branches: [[name: 'FETCH_HEAD']],
57 userRemoteConfigs: [[
58 refspec: 'refs/tags/$MCUBOOT_VERSION',
59 url: params.MCUBOOT_URL
60 ]]
61 ]
62 )
63 }
Dean Birch62c4f082020-01-17 16:13:26 +000064 sh """
Dean Birch7249bfa2020-05-21 16:22:39 +010065 # Host https://github.com/Arm-software/CMSIS_5/releases/download/5.5.0/ARM.CMSIS.5.5.0.pack
66 # under \$JENKINS_HOME/userContent
67 set +e
68 wget -O cmsis.pack -q \${JENKINS_URL}/userContent/ARM.CMSIS.${CMSIS_VERSION}.pack
69 if [ "\$?" != "0" ] ; then
70 set -e
71 wget -O cmsis.pack -q https://github.com/Arm-software/CMSIS_5/releases/download/${CMSIS_VERSION}/ARM.CMSIS.${CMSIS_VERSION}.pack
72 fi
73 set -e
74 unzip -o -d CMSIS_5 cmsis.pack
75 """
Dean Birchd0f9f8c2020-03-26 11:10:33 +000076 if (env.PSA_API_SUITE != "") {
77 dir("psa-arch-tests") {
78 checkout(
79 changelog: false,
80 poll: false,
81 scm: [
82 $class: 'GitSCM',
83 branches: [[name: 'FETCH_HEAD']],
84 userRemoteConfigs: [[
Karl Zhanga6820f22020-06-17 11:34:06 +080085 refspec: '$PSA_ARCH_TESTS_VERSION',
Matthew Hartfb6fd362020-03-04 21:03:59 +000086 url: params.PSA_ARCH_TESTS_URL
Dean Birchd0f9f8c2020-03-26 11:10:33 +000087 ]]
88 ]
89 )
90 }
91 }
Dean Birch62c4f082020-01-17 16:13:26 +000092 }
Dean Birchd0f9f8c2020-03-26 11:10:33 +000093 try {
94 verify = 1
95 stage("Build") {
96 tee("build.log") {
97 sh "tf-m-ci-scripts/run-build.sh"
98 }
99 }
100 stage("Post") {
101 archiveArtifacts 'trusted-firmware-m/build/install/**,build.log'
102 }
103 } catch (Exception e) {
104 manager.buildFailure()
105 verify = -1
106 } finally {
107 g = new Gerrit()
108 g.verifyStatusInWorkspace(verify, env.CONFIG_NAME, 'build')
Matthew Hartfb6fd362020-03-04 21:03:59 +0000109 def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
110 //g.commentInWorkspace("Build configuration ${env.CONFIG_NAME} ${buildStatus}: ${env.RUN_DISPLAY_URL}")
Dean Birch62c4f082020-01-17 16:13:26 +0000111 cleanWs()
112 }
113}