blob: 6dcedefcf3c02fbb38cbb5d5ff3a131dbc662872 [file] [log] [blame]
Dean Birch62c4f082020-01-17 16:13:26 +00001#!/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 Birchd0f9f8c2020-03-26 11:10:33 +00009@Library('trustedfirmware') _
10import org.trustedfirmware.Gerrit
Dean Birch62c4f082020-01-17 16:13:26 +000011
Benjamin Copelandbe53b032020-10-30 19:57:59 +000012node("docker-amd64-tf-m-bionic") {
Dean Birch62c4f082020-01-17 16:13:26 +000013 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']]])
Dean Birch62c4f082020-01-17 16:13:26 +000030 }
Dean Birch62c4f082020-01-17 16:13:26 +000031 }
32 stage("Check") {
33 def verify = 1
34 try {
35 sh """
36cd 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 Birchd0f9f8c2020-03-26 11:10:33 +000044 g = new Gerrit()
45 g.verifyStatusInWorkspace(verify, 'checkpatch', 'static')
Matthew Hartfb6fd362020-03-04 21:03:59 +000046 def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
47 //g.commentInWorkspace("Build checkpatch ${buildStatus}: ${env.RUN_DISPLAY_URL}")
Dean Birch62c4f082020-01-17 16:13:26 +000048 cleanWs()
49 }
50 }
51}