blob: 912c60f98b0fa7b92fc45166930cb611429ba1c2 [file] [log] [blame]
#!/usr/bin/env groovy
//-------------------------------------------------------------------------------
// Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
//
// SPDX-License-Identifier: BSD-3-Clause
//
//-------------------------------------------------------------------------------
@Library('trustedfirmware') _
import org.trustedfirmware.Gerrit
def nodeLabel = "docker-amd64-tf-m-bionic"
if (env.COMPILER == "ARMCLANG") {
nodeLabel = "docker-amd64-tf-m-bionic"
}
node(nodeLabel) {
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") {
checkout(
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: '$CI_SCRIPTS_BRANCH']],
extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
userRemoteConfigs: [[
credentialsId: 'GIT_SSH_KEY',
refspec: '$CI_SCRIPTS_REFSPEC', url: '$CI_SCRIPTS_REPO'
]]
])
}
dir("mbedtls") {
checkout(
changelog: false,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[
refspec: 'refs/tags/$MBEDTLS_VERSION',
url: params.MBEDTLS_URL
]]
]
)
}
dir("mcuboot") {
checkout(
changelog: false,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[
refspec: '$MCUBOOT_REFSPEC',
url: params.MCUBOOT_URL
]]
]
)
}
dir("tf-m-tests") {
checkout(
changelog: false,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[
refspec: '$TFM_TESTS_REFSPEC',
url: params.TFM_TESTS_URL
]]
]
)
}
if (env.PSA_API_SUITE != "") {
dir("psa-arch-tests") {
checkout(
changelog: false,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[
refspec: '$PSA_ARCH_TESTS_VERSION',
url: params.PSA_ARCH_TESTS_URL
]]
]
)
}
}
}
try {
verify = 1
stage("Build") {
sh "tf-m-ci-scripts/run-build.sh"
}
stage("Post") {
archiveArtifacts 'trusted-firmware-m/build/bin/**'
archiveArtifacts 'trusted-firmware-m/build/install/export/**'
}
} catch (Exception e) {
manager.buildFailure()
verify = -1
} finally {
g = new Gerrit()
g.verifyStatusInWorkspace(verify, env.CONFIG_NAME, 'build')
def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
//g.commentInWorkspace("Build configuration ${env.CONFIG_NAME} ${buildStatus}: ${env.RUN_DISPLAY_URL}")
cleanWs()
}
}