blob: f43ef58c03fac2b78d5aaf05d11d0a37d55841e1 [file] [log] [blame]
#!/usr/bin/env groovy
//-------------------------------------------------------------------------------
// Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
//
// SPDX-License-Identifier: BSD-3-Clause
//
//-------------------------------------------------------------------------------
def verifyStatus(value, stage_name) {
withCredentials([usernamePassword(credentialsId: 'VERIFY_STATUS', passwordVariable: 'VERIFY_PASSWORD', usernameVariable: 'VERIFY_USER')]) {
sh """
if [ -z "\$GERRIT_HOST" ] ; then
echo Not running for a Gerrit change, skipping vote.
exit 0
fi
if [ ! -d venv ] ; then
virtualenv -p \$(which python3) venv
fi
. venv/bin/activate
pip -q install requests
./tf-m-ci-scripts/jenkins/verify.py --value ${value} --verify-name tf-m-${stage_name} --user \$VERIFY_USER
"""
}
}
node("docker-amd64-xenial") {
stage("Init") {
cleanWs()
dir("trusted-firmware-m") {
checkout(
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: '$GERRIT_BRANCH']],
extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
userRemoteConfigs: [[
credentialsId: 'GIT_SSH_KEY',
refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO'
]]
])
}
dir("tf-m-ci-scripts") {
git url: '$CI_SCRIPTS_REPO', branch: 'master', credentialsId: 'GIT_SSH_KEY'
}
dir("mbed-crypto") {
checkout(
changelog: false,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[
refspec: 'refs/tags/$MBEDCRYPTO_VERSION',
url: 'https://github.com/ARMmbed/mbed-crypto.git'
]]
]
)
}
sh """
wget -O cmsis.pack -q https://github.com/ARM-software/CMSIS_5/releases/download/${CMSIS_VERSION}/ARM.CMSIS.${CMSIS_VERSION}.pack
unzip -o -d CMSIS_5 cmsis.pack
"""
}
stage("Check") {
def verify = 1
try {
sh """
cd trusted-firmware-m
../tf-m-ci-scripts/run-checkpatch.sh -u
../tf-m-ci-scripts/run-checkpatch.sh -r -l 1
"""
} catch (Exception e) {
manager.buildFailure()
verify = -1
} finally {
verifyStatus(verify, 'checkpatch')
cleanWs()
}
}
}