blob: 4aacad1d446b99ef2d22b4cc84e586778878957c [file] [log] [blame]
Leonardo Sandoval2d207d02020-08-05 13:54:52 -05001#!/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') _
10import org.trustedfirmware.Gerrit
11
Xinyu Zhang4cdfd1b2021-05-21 15:10:49 +080012timestamps {
13 node("docker-amd64-tf-m-bionic") {
14 stage("Init") {
Leonardo Sandoval2d207d02020-08-05 13:54:52 -050015 cleanWs()
Xinyu Zhang4cdfd1b2021-05-21 15:10:49 +080016 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 Sandoval2d207d02020-08-05 13:54:52 -050050 }
51 }
52}