Leonardo Sandoval | 2d207d0 | 2020-08-05 13:54:52 -0500 | [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 | |
| 9 | @Library('trustedfirmware') _ |
| 10 | import org.trustedfirmware.Gerrit |
| 11 | |
Xinyu Zhang | 4cdfd1b | 2021-05-21 15:10:49 +0800 | [diff] [blame^] | 12 | timestamps { |
| 13 | node("docker-amd64-tf-m-bionic") { |
| 14 | stage("Init") { |
Leonardo Sandoval | 2d207d0 | 2020-08-05 13:54:52 -0500 | [diff] [blame] | 15 | cleanWs() |
Xinyu Zhang | 4cdfd1b | 2021-05-21 15:10:49 +0800 | [diff] [blame^] | 16 | dir("trusted-firmware-m") { |
| 17 | checkout( |
| 18 | poll: false, |
| 19 | scm: [ |
| 20 | $class: 'GitSCM', |
| 21 | branches: [[name: '$GERRIT_BRANCH']], |
| 22 | extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]], |
| 23 | userRemoteConfigs: [[ |
| 24 | credentialsId: 'GIT_SSH_KEY', |
| 25 | refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO' |
| 26 | ]] |
| 27 | ]) |
| 28 | } |
| 29 | dir("tf-m-ci-scripts") { |
| 30 | checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]]) |
| 31 | } |
| 32 | } |
| 33 | stage("Check") { |
| 34 | def verify = 1 |
| 35 | try { |
| 36 | sh """ |
| 37 | cd trusted-firmware-m |
| 38 | IS_CONTINUOUS_INTEGRATION=1 ../tf-m-ci-scripts/run-static-checks.sh |
| 39 | """ |
| 40 | } catch (Exception e) { |
| 41 | manager.buildFailure() |
| 42 | verify = -1 |
| 43 | } finally { |
| 44 | g = new Gerrit() |
| 45 | g.verifyStatusInWorkspace(verify, 'static-checks', 'static') |
| 46 | def buildStatus = (verify == 1) ? 'Successful' : 'Failed' |
| 47 | //g.commentInWorkspace("Build checkpatch ${buildStatus}: ${env.RUN_DISPLAY_URL}") |
| 48 | cleanWs() |
| 49 | } |
Leonardo Sandoval | 2d207d0 | 2020-08-05 13:54:52 -0500 | [diff] [blame] | 50 | } |
| 51 | } |
| 52 | } |