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 | |
Benjamin Copeland | be53b03 | 2020-10-30 19:57:59 +0000 | [diff] [blame] | 12 | node("docker-amd64-tf-m-bionic") { |
Leonardo Sandoval | 2d207d0 | 2020-08-05 13:54:52 -0500 | [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']]]) |
Leonardo Sandoval | 2d207d0 | 2020-08-05 13:54:52 -0500 | [diff] [blame] | 30 | } |
| 31 | } |
| 32 | stage("Check") { |
| 33 | def verify = 1 |
| 34 | try { |
| 35 | sh """ |
| 36 | cd trusted-firmware-m |
| 37 | IS_CONTINUOUS_INTEGRATION=1 ../tf-m-ci-scripts/run-static-checks.sh |
| 38 | """ |
| 39 | } catch (Exception e) { |
| 40 | manager.buildFailure() |
| 41 | verify = -1 |
| 42 | } finally { |
| 43 | g = new Gerrit() |
| 44 | g.verifyStatusInWorkspace(verify, 'static-checks', 'static') |
| 45 | def buildStatus = (verify == 1) ? 'Successful' : 'Failed' |
| 46 | //g.commentInWorkspace("Build checkpatch ${buildStatus}: ${env.RUN_DISPLAY_URL}") |
| 47 | cleanWs() |
| 48 | } |
| 49 | } |
| 50 | } |