blob: f766024d3f794946a55ab124c8c22f21d71da5f8 [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
Benjamin Copelandbe53b032020-10-30 19:57:59 +000012node("docker-amd64-tf-m-bionic") {
Leonardo Sandoval2d207d02020-08-05 13:54:52 -050013 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 Thorbinson58703db2020-11-24 12:02:19 +000029 checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]])
Leonardo Sandoval2d207d02020-08-05 13:54:52 -050030 }
31 }
32 stage("Check") {
33 def verify = 1
34 try {
35 sh """
36cd trusted-firmware-m
37IS_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}