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 | |
Benjamin Copeland | be53b03 | 2020-10-30 19:57:59 +0000 | [diff] [blame] | 12 | node("docker-amd64-tf-m-bionic") { |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 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") { |
Colin Thorbinson | 58703db | 2020-11-24 12:02:19 +0000 | [diff] [blame] | 29 | checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]]) |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 30 | } |
Karl Zhang | 02d3035 | 2020-08-20 13:48:52 +0800 | [diff] [blame] | 31 | dir("mbedtls") { |
| 32 | checkout( |
| 33 | changelog: false, |
| 34 | poll: false, |
| 35 | scm: [ |
| 36 | $class: 'GitSCM', |
| 37 | branches: [[name: 'FETCH_HEAD']], |
| 38 | userRemoteConfigs: [[ |
| 39 | refspec: 'refs/tags/$MBEDTLS_VERSION', |
| 40 | url: params.MBEDTLS_URL |
| 41 | ]] |
| 42 | ] |
| 43 | ) |
| 44 | } |
Kevin Peng | 59abf99 | 2020-06-19 16:35:45 +0800 | [diff] [blame] | 45 | dir("mcuboot") { |
| 46 | checkout( |
| 47 | changelog: false, |
| 48 | poll: false, |
| 49 | scm: [ |
| 50 | $class: 'GitSCM', |
| 51 | branches: [[name: 'FETCH_HEAD']], |
| 52 | userRemoteConfigs: [[ |
Tamas Ban | 1f1213e | 2020-09-25 12:38:31 +0100 | [diff] [blame] | 53 | refspec: '$MCUBOOT_REFSPEC', |
Kevin Peng | 59abf99 | 2020-06-19 16:35:45 +0800 | [diff] [blame] | 54 | url: params.MCUBOOT_URL |
| 55 | ]] |
| 56 | ] |
| 57 | ) |
| 58 | } |
Karl Zhang | 543849b | 2020-06-19 15:35:22 +0800 | [diff] [blame] | 59 | dir("tf-m-tests") { |
| 60 | checkout( |
| 61 | changelog: false, |
| 62 | poll: false, |
| 63 | scm: [ |
| 64 | $class: 'GitSCM', |
| 65 | branches: [[name: 'FETCH_HEAD']], |
| 66 | userRemoteConfigs: [[ |
| 67 | refspec: '$TFM_TESTS_REFSPEC', |
| 68 | url: params.TFM_TESTS_URL |
| 69 | ]] |
| 70 | ] |
| 71 | ) |
| 72 | } |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 73 | } |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 74 | try { |
| 75 | verify = 1 |
| 76 | stage("Build") { |
| 77 | sh "tf-m-ci-scripts/build-docs.sh" |
| 78 | } |
| 79 | stage("Post") { |
Xinyu Zhang | b708f57 | 2020-09-15 11:43:46 +0800 | [diff] [blame] | 80 | archiveArtifacts 'trusted-firmware-m/build/docs/**' |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 81 | } |
| 82 | } catch (Exception e) { |
| 83 | manager.buildFailure() |
| 84 | verify = -1 |
| 85 | } finally { |
| 86 | g = new Gerrit() |
| 87 | g.verifyStatusInWorkspace(verify, 'tf-m-build-docs', 'build') |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 88 | def buildStatus = (verify == 1) ? 'Successful' : 'Failed' |
| 89 | //g.commentInWorkspace("Build docs ${buildStatus}: ${env.RUN_DISPLAY_URL}") |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 90 | cleanWs() |
| 91 | } |
| 92 | } |