2019-11-22 13:50:19 +00:00
|
|
|
pipeline{
|
2019-12-11 13:55:40 +00:00
|
|
|
agent none
|
2019-11-22 13:50:19 +00:00
|
|
|
stages {
|
2020-02-07 16:56:08 +00:00
|
|
|
stage ('Early checks') {
|
2019-12-11 13:55:40 +00:00
|
|
|
agent { node { label 'master' } }
|
|
|
|
stages {
|
2019-12-11 16:49:32 +00:00
|
|
|
stage ('Check for RFC/WIP builds') {
|
|
|
|
when {
|
|
|
|
changeRequest comparator: 'REGEXP', title: '.*(rfc|RFC|wip|WIP).*'
|
|
|
|
beforeAgent true
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
error("Failing as this is marked as a WIP or RFC PR.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Cancel older builds') {
|
2020-03-05 10:33:51 +00:00
|
|
|
when { not { branch 'master' } }
|
2019-12-11 13:55:40 +00:00
|
|
|
steps {
|
|
|
|
cancelPreviousBuilds()
|
|
|
|
}
|
|
|
|
}
|
2019-11-22 13:50:19 +00:00
|
|
|
}
|
2019-05-23 15:45:13 +00:00
|
|
|
}
|
2020-02-07 16:56:08 +00:00
|
|
|
stage ('Build') {
|
2021-01-08 11:11:56 +00:00
|
|
|
parallel {
|
2020-02-07 16:56:08 +00:00
|
|
|
stage ('Worker build') {
|
2020-10-26 16:39:03 +00:00
|
|
|
agent { node { label 'groovy' } }
|
2020-02-07 16:56:08 +00:00
|
|
|
stages {
|
|
|
|
stage ('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
2020-08-13 14:56:22 +00:00
|
|
|
stage ('Run OpenAPI tests') {
|
|
|
|
steps {
|
|
|
|
sh "scripts/run_openapi_tests.sh"
|
|
|
|
}
|
|
|
|
}
|
2020-02-17 15:07:01 +00:00
|
|
|
stage ('Run unit tests') {
|
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --unit"
|
|
|
|
}
|
|
|
|
}
|
2020-02-07 16:56:08 +00:00
|
|
|
stage ('Run integration tests') {
|
2020-11-27 16:39:03 +00:00
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
|
|
|
}
|
2020-02-07 16:56:08 +00:00
|
|
|
steps {
|
2020-02-10 15:19:49 +00:00
|
|
|
sh "scripts/dev_cli.sh tests --integration"
|
2020-02-07 16:56:08 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-10 07:47:18 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-07 08:59:15 +00:00
|
|
|
stage ('AArch64 worker build') {
|
|
|
|
agent { node { label 'bionic-arm64' } }
|
|
|
|
stages {
|
|
|
|
stage ('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Run unit tests') {
|
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --unit"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Run integration tests') {
|
2020-11-27 16:39:03 +00:00
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
|
|
|
}
|
2020-08-07 08:59:15 +00:00
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --integration"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 12:15:36 +00:00
|
|
|
post {
|
|
|
|
always {
|
|
|
|
sh "sudo chown -R jenkins.jenkins ${WORKSPACE}"
|
|
|
|
deleteDir()
|
|
|
|
}
|
|
|
|
}
|
2020-08-07 08:59:15 +00:00
|
|
|
}
|
2020-06-10 07:47:18 +00:00
|
|
|
stage ('Worker build (musl)') {
|
2020-10-26 16:39:03 +00:00
|
|
|
agent { node { label 'groovy' } }
|
2020-06-10 07:47:18 +00:00
|
|
|
stages {
|
|
|
|
stage ('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
2020-04-29 11:31:56 +00:00
|
|
|
stage ('Run unit tests for musl') {
|
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --unit --libc musl"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Run integration tests for musl') {
|
2020-11-27 16:39:03 +00:00
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
|
|
|
}
|
2020-04-29 11:31:56 +00:00
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --integration --libc musl"
|
|
|
|
}
|
|
|
|
}
|
2019-12-11 13:55:40 +00:00
|
|
|
}
|
|
|
|
}
|
2020-09-08 12:20:26 +00:00
|
|
|
stage ('Worker build SGX') {
|
|
|
|
agent { node { label 'bionic-sgx' } }
|
|
|
|
when { branch 'master' }
|
|
|
|
stages {
|
|
|
|
stage ('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Run SGX integration tests') {
|
2020-11-27 16:39:03 +00:00
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
|
|
|
}
|
2020-09-08 12:20:26 +00:00
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --integration-sgx"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Run SGX integration tests for musl') {
|
2020-11-27 16:39:03 +00:00
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
|
|
|
}
|
2020-09-08 12:20:26 +00:00
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --integration-sgx --libc musl"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
sh "sudo chown -R jenkins.jenkins ${WORKSPACE}"
|
|
|
|
deleteDir()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-07 14:34:18 +00:00
|
|
|
stage ('Worker build - Windows guest') {
|
2020-10-26 16:39:03 +00:00
|
|
|
agent { node { label 'groovy-win' } }
|
2020-10-07 14:34:18 +00:00
|
|
|
stages {
|
|
|
|
stage ('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
2021-01-08 15:47:05 +00:00
|
|
|
stage ('Download assets') {
|
|
|
|
steps {
|
|
|
|
sh "mkdir ${env.HOME}/workloads"
|
|
|
|
azureDownload(storageCredentialId: 'ch-image-store',
|
|
|
|
containerName: 'private-images',
|
|
|
|
includeFilesPattern: 'OVMF.fd',
|
|
|
|
downloadType: 'container',
|
|
|
|
downloadDirLoc: "${env.HOME}/workloads")
|
|
|
|
azureDownload(storageCredentialId: 'ch-image-store',
|
|
|
|
containerName: 'private-images',
|
|
|
|
includeFilesPattern: 'windows-server-2019.raw',
|
|
|
|
downloadType: 'container',
|
|
|
|
downloadDirLoc: "${env.HOME}/workloads")
|
|
|
|
}
|
|
|
|
}
|
2020-10-07 14:34:18 +00:00
|
|
|
stage ('Run Windows guest integration tests') {
|
2020-11-27 16:39:03 +00:00
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
|
|
|
}
|
2020-10-07 14:34:18 +00:00
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --integration-windows"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Run Windows guest integration tests for musl') {
|
2020-11-27 16:39:03 +00:00
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
|
|
|
}
|
2020-10-07 14:34:18 +00:00
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --integration-windows --libc musl"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-11 07:49:06 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-11 13:55:40 +00:00
|
|
|
}
|
2020-08-05 09:39:19 +00:00
|
|
|
post {
|
|
|
|
regression {
|
2020-08-05 12:29:52 +00:00
|
|
|
script {
|
|
|
|
if (env.BRANCH_NAME == 'master') {
|
|
|
|
slackSend (color: '#ff0000', message: '"master" branch build is now failing')
|
|
|
|
}
|
|
|
|
}
|
2020-08-05 09:39:19 +00:00
|
|
|
}
|
|
|
|
fixed {
|
2020-08-05 12:29:52 +00:00
|
|
|
script {
|
|
|
|
if (env.BRANCH_NAME == 'master') {
|
|
|
|
slackSend (color: '#00ff00', message: '"master" branch build is now fixed')
|
|
|
|
}
|
|
|
|
}
|
2020-08-05 09:39:19 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-11 13:55:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def cancelPreviousBuilds() {
|
|
|
|
// Check for other instances of this particular build, cancel any that are older than the current one
|
|
|
|
def jobName = env.JOB_NAME
|
|
|
|
def currentBuildNumber = env.BUILD_NUMBER.toInteger()
|
|
|
|
def currentJob = Jenkins.instance.getItemByFullName(jobName)
|
|
|
|
|
|
|
|
// Loop through all instances of this particular job/branch
|
|
|
|
for (def build : currentJob.builds) {
|
|
|
|
if (build.isBuilding() && (build.number.toInteger() < currentBuildNumber)) {
|
|
|
|
echo "Older build still queued. Sending kill signal to build number: ${build.number}"
|
|
|
|
build.doStop()
|
2019-11-22 13:50:19 +00:00
|
|
|
}
|
2019-05-23 15:45:13 +00:00
|
|
|
}
|
2020-06-17 10:16:19 +00:00
|
|
|
}
|