blob: e43409014b6816d8a1acb9052f73e6f33ba6f94d [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
Dean Birch62c4f082020-01-17 16:13:26 +000012node("docker-amd64-xenial") {
13 stage("Init") {
14 cleanWs()
15 dir("trusted-firmware-m") {
16 checkout(
17 poll: false,
18 scm: [
19 $class: 'GitSCM',
20 branches: [[name: '$GERRIT_BRANCH']],
21 extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
22 userRemoteConfigs: [[
23 credentialsId: 'GIT_SSH_KEY',
24 refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO'
25 ]]
26 ])
27 }
28 dir("tf-m-ci-scripts") {
Matthew Hartfb6fd362020-03-04 21:03:59 +000029 git url: '$CI_SCRIPTS_REPO', branch: '$CI_SCRIPTS_BRANCH', credentialsId: 'GIT_SSH_KEY'
Dean Birch62c4f082020-01-17 16:13:26 +000030 }
31 dir("mbed-crypto") {
32 checkout(
33 changelog: false,
34 poll: false,
35 scm: [
36 $class: 'GitSCM',
Matthew Hartfb6fd362020-03-04 21:03:59 +000037 branches: [[name: 'FETCH_HEAD']],
Dean Birch62c4f082020-01-17 16:13:26 +000038 userRemoteConfigs: [[
39 refspec: 'refs/tags/$MBEDCRYPTO_VERSION',
Dean Bircha6ede7e2020-03-13 14:00:33 +000040 url: params.MBEDCRYPTO_URL
Dean Birch62c4f082020-01-17 16:13:26 +000041 ]]
42 ]
43 )
44 }
Kevin Peng59abf992020-06-19 16:35:45 +080045 dir("mcuboot") {
46 checkout(
47 changelog: false,
48 poll: false,
49 scm: [
50 $class: 'GitSCM',
51 branches: [[name: 'FETCH_HEAD']],
52 userRemoteConfigs: [[
53 refspec: 'refs/tags/$MCUBOOT_VERSION',
54 url: params.MCUBOOT_URL
55 ]]
56 ]
57 )
58 }
Dean Birch62c4f082020-01-17 16:13:26 +000059 sh """
Dean Birch7249bfa2020-05-21 16:22:39 +010060 # Host https://github.com/Arm-software/CMSIS_5/releases/download/5.5.0/ARM.CMSIS.5.5.0.pack
61 # under \$JENKINS_HOME/userContent
62 set +e
63 wget -O cmsis.pack -q \${JENKINS_URL}/userContent/ARM.CMSIS.${CMSIS_VERSION}.pack
64 if [ "\$?" != "0" ] ; then
65 set -e
66 wget -O cmsis.pack -q https://github.com/Arm-software/CMSIS_5/releases/download/${CMSIS_VERSION}/ARM.CMSIS.${CMSIS_VERSION}.pack
67 fi
68 set -e
69 unzip -o -d CMSIS_5 cmsis.pack
70 """
Karl Zhang543849b2020-06-19 15:35:22 +080071 dir("tf-m-tests") {
72 checkout(
73 changelog: false,
74 poll: false,
75 scm: [
76 $class: 'GitSCM',
77 branches: [[name: 'FETCH_HEAD']],
78 userRemoteConfigs: [[
79 refspec: '$TFM_TESTS_REFSPEC',
80 url: params.TFM_TESTS_URL
81 ]]
82 ]
83 )
84 }
Dean Birch62c4f082020-01-17 16:13:26 +000085 }
Dean Birchd0f9f8c2020-03-26 11:10:33 +000086 try {
87 verify = 1
88 stage("Build") {
89 sh "tf-m-ci-scripts/build-docs.sh"
90 }
91 stage("Post") {
92 archiveArtifacts 'trusted-firmware-m/build/install/**'
93 }
94 } catch (Exception e) {
95 manager.buildFailure()
96 verify = -1
97 } finally {
98 g = new Gerrit()
99 g.verifyStatusInWorkspace(verify, 'tf-m-build-docs', 'build')
Matthew Hartfb6fd362020-03-04 21:03:59 +0000100 def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
101 //g.commentInWorkspace("Build docs ${buildStatus}: ${env.RUN_DISPLAY_URL}")
Dean Birch62c4f082020-01-17 16:13:26 +0000102 cleanWs()
103 }
104}