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 |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 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 | } |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 31 | } |
| 32 | stage("Check") { |
| 33 | def verify = 1 |
| 34 | try { |
| 35 | sh """ |
| 36 | cd trusted-firmware-m |
| 37 | ../tf-m-ci-scripts/run-checkpatch.sh -u |
| 38 | ../tf-m-ci-scripts/run-checkpatch.sh -r -l 1 |
| 39 | """ |
| 40 | } catch (Exception e) { |
| 41 | manager.buildFailure() |
| 42 | verify = -1 |
| 43 | } finally { |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 44 | g = new Gerrit() |
| 45 | g.verifyStatusInWorkspace(verify, 'checkpatch', 'static') |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 46 | def buildStatus = (verify == 1) ? 'Successful' : 'Failed' |
| 47 | //g.commentInWorkspace("Build checkpatch ${buildStatus}: ${env.RUN_DISPLAY_URL}") |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 48 | cleanWs() |
| 49 | } |
| 50 | } |
| 51 | } |