blob: 912c60f98b0fa7b92fc45166930cb611429ba1c2 [file] [log] [blame]
Xinyu Zhangf27f6032020-11-03 15:58:24 +08001#!/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
9@Library('trustedfirmware') _
10import org.trustedfirmware.Gerrit
11
Riku Voipio57e08752020-11-15 15:18:24 +020012def nodeLabel = "docker-amd64-tf-m-bionic"
Xinyu Zhangf27f6032020-11-03 15:58:24 +080013if (env.COMPILER == "ARMCLANG") {
Riku Voipio57e08752020-11-15 15:18:24 +020014 nodeLabel = "docker-amd64-tf-m-bionic"
Xinyu Zhangf27f6032020-11-03 15:58:24 +080015}
16
17node(nodeLabel) {
18 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 checkout(
35 poll: false,
36 scm: [
37 $class: 'GitSCM',
38 branches: [[name: '$CI_SCRIPTS_BRANCH']],
39 extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
40 userRemoteConfigs: [[
41 credentialsId: 'GIT_SSH_KEY',
42 refspec: '$CI_SCRIPTS_REFSPEC', url: '$CI_SCRIPTS_REPO'
43 ]]
44 ])
45 }
46 dir("mbedtls") {
47 checkout(
48 changelog: false,
49 poll: false,
50 scm: [
51 $class: 'GitSCM',
52 branches: [[name: 'FETCH_HEAD']],
53 userRemoteConfigs: [[
54 refspec: 'refs/tags/$MBEDTLS_VERSION',
55 url: params.MBEDTLS_URL
56 ]]
57 ]
58 )
59 }
60 dir("mcuboot") {
61 checkout(
62 changelog: false,
63 poll: false,
64 scm: [
65 $class: 'GitSCM',
66 branches: [[name: 'FETCH_HEAD']],
67 userRemoteConfigs: [[
68 refspec: '$MCUBOOT_REFSPEC',
69 url: params.MCUBOOT_URL
70 ]]
71 ]
72 )
73 }
74 dir("tf-m-tests") {
75 checkout(
76 changelog: false,
77 poll: false,
78 scm: [
79 $class: 'GitSCM',
80 branches: [[name: 'FETCH_HEAD']],
81 userRemoteConfigs: [[
82 refspec: '$TFM_TESTS_REFSPEC',
83 url: params.TFM_TESTS_URL
84 ]]
85 ]
86 )
87 }
88 if (env.PSA_API_SUITE != "") {
89 dir("psa-arch-tests") {
90 checkout(
91 changelog: false,
92 poll: false,
93 scm: [
94 $class: 'GitSCM',
95 branches: [[name: 'FETCH_HEAD']],
96 userRemoteConfigs: [[
97 refspec: '$PSA_ARCH_TESTS_VERSION',
98 url: params.PSA_ARCH_TESTS_URL
99 ]]
100 ]
101 )
102 }
103 }
104 }
105 try {
106 verify = 1
107 stage("Build") {
108 sh "tf-m-ci-scripts/run-build.sh"
109 }
110 stage("Post") {
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100111 archiveArtifacts 'trusted-firmware-m/build/bin/**'
112 archiveArtifacts 'trusted-firmware-m/build/install/export/**'
Xinyu Zhangf27f6032020-11-03 15:58:24 +0800113 }
114 } catch (Exception e) {
115 manager.buildFailure()
116 verify = -1
117 } finally {
118 g = new Gerrit()
119 g.verifyStatusInWorkspace(verify, env.CONFIG_NAME, 'build')
120 def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
121 //g.commentInWorkspace("Build configuration ${env.CONFIG_NAME} ${buildStatus}: ${env.RUN_DISPLAY_URL}")
122 cleanWs()
123 }
124}