blob: 9432f74ab574f434d69565b2a9caef39282601c2 [file] [log] [blame]
pipeline {
agent none
options {
timeout(time: 60, unit: 'MINUTES')
}
stages {
// start bess-upf on a host server
stage('Start BESS-UPF') {
agent {
label "${params.UPF_HOST_NODE}"
}
steps {
cleanWs()
// clone upf-epc repo
git branch: "${params.GIT_BRANCH}", credentialsId: 'github-onf-bot-ssh-key', url: "${params.GIT_URL}"
// overwrite config files with personalized config
sh 'cp ptf/config/docker_setup.sh .'
sh 'cp ptf/config/upf.json conf/'
// build and start bess-upf
sh './docker_setup.sh'
}
}
// run tests from a different server
stage('Run linerate tests') {
agent {
label "${params.BUILD_NODE}"
}
steps {
cleanWs()
// clone upf-epc
git branch: "${params.GIT_BRANCH}", credentialsId: 'github-onf-bot-ssh-key', url: "${params.GIT_URL}"
// generate python proto files and run tests
sh 'cd ptf && bash jenkins.sh'
}
}
}
post {
always {
// stop the upf on the host server
node("${params.UPF_HOST_NODE}") {
sh 'sleep 5'
sh 'docker container kill pause bess bess-web bess-pfcpiface bess-routectl || true'
}
// archive artifacts from the other server's test runs
node("${params.BUILD_NODE}") {
archiveArtifacts artifacts: 'ptf/log/ptf-logs/*', fingerprint: true
}
}
failure {
node("${params.BUILD_NODE}") {
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${params.MAINTAINERS}", sendToIndividuals: false])
}
}
}
}