Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 1 | #!/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 Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame^] | 9 | @Library('trustedfirmware') _ |
| 10 | import org.trustedfirmware.Gerrit |
| 11 | |
| 12 | def nodeLabel = "docker-amd64-xenial" |
| 13 | if (env.COMPILER == "ARMCLANG") { |
| 14 | nodeLabel = "docker-amd64-xenial-armclang" |
| 15 | } |
| 16 | |
| 17 | node(nodeLabel) { |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 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 | 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 Birch | a6ede7e | 2020-03-13 14:00:33 +0000 | [diff] [blame] | 45 | url: params.MBEDCRYPTO_URL |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 46 | ]] |
| 47 | ] |
| 48 | ) |
| 49 | } |
| 50 | sh """ |
Dean Birch | a6ede7e | 2020-03-13 14:00:33 +0000 | [diff] [blame] | 51 | # 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 | wget -O cmsis.pack -q \${JENKINS_URL}/userContent/ARM.CMSIS.${CMSIS_VERSION}.pack |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 54 | unzip -o -d CMSIS_5 cmsis.pack |
| 55 | """ |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame^] | 56 | 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 Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 72 | } |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame^] | 73 | 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 Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 89 | cleanWs() |
| 90 | } |
| 91 | } |